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

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

Issue 2379203002: implement getBufferSubDataAsync prototype (Closed)
Patch Set: small clarification Created 4 years, 2 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 b88e99b4b6519aeac4d46d83d782e3a553d0a17b..c491a7617816b3de5d6e90a4216d29e440c24db7 100644
--- a/gpu/command_buffer/client/gles2_implementation_unittest.cc
+++ b/gpu/command_buffer/client/gles2_implementation_unittest.cc
@@ -4430,6 +4430,59 @@ TEST_F(GLES2ImplementationTest, DeleteBuffersUnmapsDataStore) {
EXPECT_EQ(GL_INVALID_OPERATION, CheckError());
}
+TEST_F(GLES3ImplementationTest, GetBufferSubDataAsyncCHROMIUM) {
+ const GLuint kBufferId = 123;
+ void* mem;
+
+ const int TARGET_COUNT = 8;
+ GLenum targets[TARGET_COUNT] = {
+ GL_ARRAY_BUFFER,
+ GL_ELEMENT_ARRAY_BUFFER,
+ GL_COPY_READ_BUFFER,
+ GL_COPY_WRITE_BUFFER,
+ GL_TRANSFORM_FEEDBACK_BUFFER,
+ GL_UNIFORM_BUFFER,
+ GL_PIXEL_PACK_BUFFER,
+ GL_PIXEL_UNPACK_BUFFER,
+ };
+
+ // Positive tests
+ for (int i = 0; i < TARGET_COUNT; i++) {
+ gl_->BindBuffer(targets[i], kBufferId);
+ mem = gl_->GetBufferSubDataAsyncCHROMIUM(targets[i], 10, 64);
+ EXPECT_TRUE(mem != nullptr);
+ EXPECT_EQ(GL_NO_ERROR, CheckError());
+ gl_->FreeSharedMemory(mem);
+ EXPECT_EQ(GL_NO_ERROR, CheckError());
+ gl_->BindBuffer(targets[i], 0);
+ }
+
+ // Negative tests: invalid target
+ for (int i = 0; i < TARGET_COUNT; i++) {
+ GLenum wrong_target = targets[(i + 1) % TARGET_COUNT];
+ gl_->BindBuffer(targets[i], kBufferId);
+ mem = gl_->GetBufferSubDataAsyncCHROMIUM(wrong_target, 10, 64);
+ EXPECT_TRUE(mem == nullptr);
+ EXPECT_EQ(GL_INVALID_OPERATION, CheckError());
+ gl_->BindBuffer(targets[i], 0);
+ }
+}
+
+TEST_F(GLES3ImplementationTest, GetBufferSubDataAsyncCHROMIUMInvalidValue) {
+ const GLuint kBufferId = 123;
+ void* mem;
+
+ gl_->BindBuffer(GL_ARRAY_BUFFER, kBufferId);
+
+ mem = gl_->GetBufferSubDataAsyncCHROMIUM(GL_ARRAY_BUFFER, -1, 64);
+ EXPECT_TRUE(mem == nullptr);
+ EXPECT_EQ(GL_INVALID_VALUE, CheckError());
+
+ mem = gl_->GetBufferSubDataAsyncCHROMIUM(GL_ARRAY_BUFFER, 0, -1);
+ EXPECT_TRUE(mem == nullptr);
+ EXPECT_EQ(GL_INVALID_VALUE, CheckError());
+}
+
TEST_F(GLES2ImplementationTest, GetInternalformativ) {
const GLint kNumSampleCounts = 8;
struct Cmds {
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation_autogen.h ('k') | gpu/command_buffer/client/gles2_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698