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

Unified Diff: gpu/command_buffer/client/gles2_implementation_unittest.cc

Issue 1165553003: Fine tuning glGetInternalformativ. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/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;

Powered by Google App Engine
This is Rietveld 408576698