Fixed #2416: modify some code to let tests works.

modify some code to let tests works.
1. OpenGL tests
2. remove a superfluous testcase of LayerTests