Short story: check and replace the thermal paste over the CPU and GPU.
Long story:
I had the same problem, notebook freezing and after a few seconds a black screen (most of the times a regular shutdown). Took it to the Apple Store for a diagnostic and everything seemed normal to them, although they offered a continuous test during several days, which I declined. I needed the machine and the freezes weren't that often. I installed smcFanControl and that seemed to alleviate the problem.
Things got worse and I noticed the crashes were happening when the notebook switched from the discrete to the integrated GPU (used gfxCardStatus for that). For example, if I ran an html game on Chrome (with hardware acceleration enabled) and that switched to the discrete GPU, after 5 minutes and closing the tab I would get the freeze almost every time.
Before going to the Apple Store again and be told that the logic board needed to be replaced, I removed the heatsink to see the state of the thermal paste. It was dry and cracked, so I bought some Arctic Silver MX-4, cleaned the old paste and put the new one. Fixed the issue and the notebook has been working with no problems so far.