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

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

Issue 932963003: Add glClientWaitSync to GPU command buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove using of union Created 5 years, 10 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 52a2cefa38366b13883d2a9805acb9af860b6b71..6234a0d3eac96b448cff719064fe4ea493e792c6 100644
--- a/gpu/command_buffer/client/gles2_implementation_unittest.cc
+++ b/gpu/command_buffer/client/gles2_implementation_unittest.cc
@@ -3583,7 +3583,7 @@ TEST_F(GLES2ImplementationTest, IsEnabled) {
expected.cmd.Init(kCap, result1.id, result1.offset);
EXPECT_CALL(*command_buffer(), OnFlush())
- .WillOnce(SetMemory(result1.ptr, uint32_t(kCap)))
+ .WillOnce(SetMemory(result1.ptr, uint32_t(GL_TRUE)))
.RetiresOnSaturation();
GLboolean result = gl_->IsEnabled(kCap);
@@ -3591,6 +3591,32 @@ TEST_F(GLES2ImplementationTest, IsEnabled) {
EXPECT_TRUE(result);
}
+TEST_F(GLES2ImplementationTest, ClientWaitSync) {
+ const GLuint client_sync_id = 36;
+ struct Cmds {
+ cmds::ClientWaitSync cmd;
+ };
+
+ Cmds expected;
+ ExpectedMemoryInfo result1 =
+ GetExpectedResultMemory(sizeof(cmds::ClientWaitSync::Result));
+ const GLuint64 kTimeout = 0xABCDEF0123456789;
+ uint32_t v32_0 = 0, v32_1 = 0;
+ GLES2Util::MapUint64ToTwoUint32(kTimeout, &v32_0, &v32_1);
+ expected.cmd.Init(client_sync_id, GL_SYNC_FLUSH_COMMANDS_BIT,
+ v32_0, v32_1, result1.id, result1.offset);
+
+ EXPECT_CALL(*command_buffer(), OnFlush())
+ .WillOnce(SetMemory(result1.ptr, uint32_t(GL_CONDITION_SATISFIED)))
+ .RetiresOnSaturation();
+
+ GLenum result = gl_->ClientWaitSync(
+ reinterpret_cast<GLsync>(client_sync_id), GL_SYNC_FLUSH_COMMANDS_BIT,
+ kTimeout);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+ EXPECT_EQ(static_cast<GLenum>(GL_CONDITION_SATISFIED), 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