There is actually a Canadian Border Patrol TV show you can watch, and they don't even try and hide that they do this. They very openly show when they check someones phone and laptop. I have seen it on the show, and they have shown them "catching" people. They'll usually use it to check if people are intending to stay and work in Canada, such as seeing in their texts or emails that they were arranging work and/or places to live.
They have shown this very thing on the show where they found on their device that they were making these arrangements. It seemed very invasive and disturbing. They got their password and were looking at their phone and laptop in a backroom. The traveller didn't even get to see what they are doing or anything.
I don't have anything to hide, but I would never feel comfortable with ANYONE having free reign over my unlocked devices, especially not a government border agent doing it behind closed doors.