I had a similar problem. I built a pc with a cheap 600watt PSU. Anytime I would play a graphics intensive game it would just shut off. After ruling out everything else, I swapped the power supply for a nice Antec and haven't had the problem since.
I have a power supply tester and the old one passes every time - so as far as I know the only way to diagnose this is to change the power supply and see if it works.
Hope that helps!