I've found this on the net somewhere and I've tested. 

Open the dial panel, entering, *#*#2846579#*#*, then, select "MMITest_II".
Now you will be in the factory test mode. it includes all sorts HW tests.


Note: the "volume down" key is for next test, the menu touch key is for the result.