Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc

Issue 1095893002: gpu: Fix some context lost marking glitches+leaks and add UMA stats (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: kbr's comment Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 cae6c006b75b3b621bd50fa5daeedbf30c47988c..d3a20b3c2a7aa89e0e094f25438175a3c62b7875 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
@@ -1125,17 +1125,30 @@ TEST_P(GLES2DecoderManualInitTest, ImmutableCopyTexImage2D) {
EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
}
-TEST_P(GLES2DecoderTest, LoseContextCHROMIUMValidArgs) {
- EXPECT_CALL(*mock_decoder_, LoseContext(GL_GUILTY_CONTEXT_RESET_ARB))
+TEST_P(GLES2DecoderTest, LoseContextCHROMIUMGuilty) {
+ EXPECT_CALL(*mock_decoder_, MarkContextLost(error::kInnocent))
.Times(1);
cmds::LoseContextCHROMIUM cmd;
- cmd.Init(GL_GUILTY_CONTEXT_RESET_ARB, GL_GUILTY_CONTEXT_RESET_ARB);
+ cmd.Init(GL_GUILTY_CONTEXT_RESET_ARB, GL_INNOCENT_CONTEXT_RESET_ARB);
EXPECT_EQ(error::kLostContext, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ EXPECT_TRUE(decoder_->WasContextLost());
+ EXPECT_TRUE(decoder_->WasContextLostByRobustnessExtension());
+}
+
+TEST_P(GLES2DecoderTest, LoseContextCHROMIUMUnkown) {
+ EXPECT_CALL(*mock_decoder_, MarkContextLost(error::kUnknown))
+ .Times(1);
+ cmds::LoseContextCHROMIUM cmd;
+ cmd.Init(GL_UNKNOWN_CONTEXT_RESET_ARB, GL_UNKNOWN_CONTEXT_RESET_ARB);
+ EXPECT_EQ(error::kLostContext, ExecuteCmd(cmd));
+ EXPECT_EQ(GL_NO_ERROR, GetGLError());
+ EXPECT_TRUE(decoder_->WasContextLost());
+ EXPECT_TRUE(decoder_->WasContextLostByRobustnessExtension());
}
TEST_P(GLES2DecoderTest, LoseContextCHROMIUMInvalidArgs0_0) {
- EXPECT_CALL(*mock_decoder_, LoseContext(_))
+ EXPECT_CALL(*mock_decoder_, MarkContextLost(_))
.Times(0);
cmds::LoseContextCHROMIUM cmd;
cmd.Init(GL_NONE, GL_GUILTY_CONTEXT_RESET_ARB);
@@ -1144,7 +1157,7 @@ TEST_P(GLES2DecoderTest, LoseContextCHROMIUMInvalidArgs0_0) {
}
TEST_P(GLES2DecoderTest, LoseContextCHROMIUMInvalidArgs1_0) {
- EXPECT_CALL(*mock_decoder_, LoseContext(_))
+ EXPECT_CALL(*mock_decoder_, MarkContextLost(_))
.Times(0);
cmds::LoseContextCHROMIUM cmd;
cmd.Init(GL_GUILTY_CONTEXT_RESET_ARB, GL_NONE);
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_mock.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698