Index: gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc |
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc |
index 910cb0104b214ec80de4dd7872f5a70f1904a145..39908af708cadfa41d868f83e74f08807fd4a74d 100644 |
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc |
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc |
@@ -8820,6 +8820,56 @@ TEST_F(GLES2DecoderTest, DiscardFramebufferEXTUnsupported) { |
EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); |
} |
+TEST_F(GLES2DecoderManualInitTest, RestoreState) { |
+ InitDecoder( |
+ "", // extensions |
+ false, // has alpha |
+ false, // has depth |
+ false, // has stencil |
+ false, // request alpha |
+ false, // request depth |
+ false, // request stencil |
+ true); // bind generates resource |
+ SetupTexture(); |
no sievers
2013/12/20 17:37:07
You could actually put the expectations in the rig
kaanb
2014/01/07 23:33:42
Done.
|
+ // TODO(kaanb): do not hardcode size |
no sievers
2013/12/20 17:37:07
I think group().max_texture_units() is what you ar
kaanb
2014/01/07 23:33:42
Done.
|
+ EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE0)) |
+ .Times(2) |
+ .RetiresOnSaturation(); |
+ EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE1)) |
+ .Times(1) |
+ .RetiresOnSaturation(); |
+ EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE2)) |
+ .Times(1) |
+ .RetiresOnSaturation(); |
+ EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE3)) |
+ .Times(1) |
+ .RetiresOnSaturation(); |
+ EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE4)) |
+ .Times(1) |
+ .RetiresOnSaturation(); |
+ EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE5)) |
+ .Times(1) |
+ .RetiresOnSaturation(); |
+ EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE6)) |
+ .Times(1) |
+ .RetiresOnSaturation(); |
+ EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE7)) |
+ .Times(1) |
+ .RetiresOnSaturation(); |
+ |
+ EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, 304)) |
+ .Times(1) |
+ .RetiresOnSaturation(); |
+ EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_2D, 702)) |
+ .Times(7) |
+ .RetiresOnSaturation(); |
+ EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_CUBE_MAP, 704)) |
+ .Times(8) |
+ .RetiresOnSaturation(); |
+ |
+ GetDecoder()->RestoreAllTextureUnitBindings(NULL); |
+} |
+ |
// TODO(gman): Complete this test. |
// TEST_F(GLES2DecoderTest, CompressedTexImage2DGLError) { |
// } |