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

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

Issue 859043005: Add Sync related APIs to GPU command buffer: Part I (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make win bots happy Created 5 years, 11 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 8dbf2526a8e4dbde4fc1545a6799e08f14cb4e66..c69886ae50f810ca274d312a4793af899a4e121e 100644
--- a/gpu/command_buffer/client/gles2_implementation_unittest.cc
+++ b/gpu/command_buffer/client/gles2_implementation_unittest.cc
@@ -3555,6 +3555,29 @@ TEST_F(GLES2ImplementationTest, AllowNestedTracesCHROMIUM) {
EXPECT_EQ(GL_INVALID_OPERATION, CheckError());
}
+TEST_F(GLES2ImplementationTest, IsEnabled) {
+ // If we use a valid enum, its state is cached on client side, so no command
+ // is actually generated, and this test will fail.
+ // TODO(zmo): it seems we never need the command. Maybe remove it.
+ GLenum kCap = 1;
+ struct Cmds {
+ cmds::IsEnabled cmd;
+ };
+
+ Cmds expected;
+ ExpectedMemoryInfo result1 =
+ GetExpectedResultMemory(sizeof(cmds::IsEnabled::Result));
+ expected.cmd.Init(kCap, result1.id, result1.offset);
+
+ EXPECT_CALL(*command_buffer(), OnFlush())
+ .WillOnce(SetMemory(result1.ptr, uint32_t(kCap)))
+ .RetiresOnSaturation();
+
+ GLboolean result = gl_->IsEnabled(kCap);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+ EXPECT_TRUE(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