Index: gpu/command_buffer/client/gles2_implementation_unittest.cc |
diff --git a/gpu/command_buffer/client/gles2_implementation_unittest.cc b/gpu/command_buffer/client/gles2_implementation_unittest.cc |
index 0b02f94897a5ed4bd92528bbfe12291bc924fb2e..db978e1cd8d2bbdc44df4d06c9421c64973ea9f4 100644 |
--- a/gpu/command_buffer/client/gles2_implementation_unittest.cc |
+++ b/gpu/command_buffer/client/gles2_implementation_unittest.cc |
@@ -3744,6 +3744,27 @@ TEST_F(GLES2ImplementationTest, DeleteBuffersUnmapsDataStore) { |
EXPECT_EQ(GL_INVALID_OPERATION, CheckError()); |
} |
+TEST_F(GLES2ImplementationTest, GetInternalformativ) { |
+ const GLint kNumSampleCounts = 8; |
+ struct Cmds { |
+ cmds::GetInternalformativ cmd; |
+ }; |
+ typedef cmds::GetInternalformativ::Result::Type ResultType; |
+ ResultType result = 0; |
+ Cmds expected; |
+ ExpectedMemoryInfo result1 = |
+ GetExpectedResultMemory(sizeof(uint32_t) + sizeof(ResultType)); |
+ expected.cmd.Init(123, GL_RGBA8, GL_NUM_SAMPLE_COUNTS, |
+ result1.id, result1.offset); |
+ EXPECT_CALL(*command_buffer(), OnFlush()) |
+ .WillOnce(SetMemory(result1.ptr, |
+ SizedResultHelper<ResultType>(kNumSampleCounts))) |
+ .RetiresOnSaturation(); |
+ gl_->GetInternalformativ(123, GL_RGBA8, GL_NUM_SAMPLE_COUNTS, 1, &result); |
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected))); |
+ EXPECT_EQ(static_cast<ResultType>(kNumSampleCounts), result); |
+} |
+ |
TEST_F(GLES2ImplementationManualInitTest, LoseContextOnOOM) { |
ContextInitOptions init_options; |
init_options.lose_context_when_out_of_memory = true; |