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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc

Issue 1747013: Changes the code to use separate ids namspaces... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 8 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/service/gles2_cmd_decoder_unittest.cc
===================================================================
--- gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc (revision 45605)
+++ gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc (working copy)
@@ -443,12 +443,14 @@
EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
// Valid id that is not a program. The GL spec requires a different error for
// this case.
+#if GLES2_TEST_SHADER_VS_PROGRAM_IDS
result->size = kInitialResult;
- cmd.Init(client_texture_id_, kUniform2Location,
+ cmd.Init(client_shader_id_, kUniform2Location,
kSharedMemoryId, kSharedMemoryOffset);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(0U, result->size);
EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+#endif // GLES2_TEST_SHADER_VS_PROGRAM_IDS
// Unlinked program
EXPECT_CALL(*gl_, CreateProgram())
.Times(1)
@@ -536,12 +538,14 @@
EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
// Valid id that is not a program. The GL spec requires a different error for
// this case.
+#if GLES2_TEST_SHADER_VS_PROGRAM_IDS
result->size = kInitialResult;
- cmd.Init(client_texture_id_, kUniform2Location,
+ cmd.Init(client_shader_id_, kUniform2Location,
kSharedMemoryId, kSharedMemoryOffset);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(0U, result->size);
EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+#endif // GLES2_TEST_SHADER_VS_PROGRAM_IDS
// Unlinked program
EXPECT_CALL(*gl_, CreateProgram())
.Times(1)
@@ -740,12 +744,14 @@
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(0, result->success);
EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
+#if GLES2_TEST_SHADER_VS_PROGRAM_IDS
result->success = 0;
- cmd.Init(client_texture_id_, kUniformIndex, kBucketId,
+ cmd.Init(client_shader_id_, kUniformIndex, kBucketId,
shared_memory_id_, shared_memory_offset_);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(0, result->success);
EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+#endif // GLES2_TEST_SHADER_VS_PROGRAM_IDS
}
TEST_F(GLES2DecoderWithShaderTest, GetActiveUniformBadIndexFails) {
@@ -818,12 +824,14 @@
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(0, result->success);
EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
+#if GLES2_TEST_SHADER_VS_PROGRAM_IDS
result->success = 0;
- cmd.Init(client_texture_id_, kAttribIndex, kBucketId,
+ cmd.Init(client_shader_id_, kAttribIndex, kBucketId,
shared_memory_id_, shared_memory_offset_);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(0, result->success);
EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+#endif // GLES2_TEST_SHADER_VS_PROGRAM_IDS
}
TEST_F(GLES2DecoderWithShaderTest, GetActiveAttribBadIndexFails) {
@@ -865,9 +873,11 @@
cmd.Init(kInvalidClientId);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
- cmd.Init(client_texture_id_);
+#if GLES2_TEST_SHADER_VS_PROGRAM_IDS
+ cmd.Init(client_program_id_);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+#endif // GLES2_TEST_SHADER_VS_PROGRAM_IDS
}
TEST_F(GLES2DecoderTest, ShaderSourceAndGetShaderSourceValidArgs) {
@@ -899,10 +909,12 @@
kSharedMemoryId, kSharedMemoryOffset, kSourceSize);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
- cmd.Init(client_texture_id_,
+#if GLES2_TEST_SHADER_VS_PROGRAM_IDS
+ cmd.Init(client_program_id_,
kSharedMemoryId, kSharedMemoryOffset, kSourceSize);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+#endif // GLES2_TEST_SHADER_VS_PROGRAM_IDS
cmd.Init(client_shader_id_,
kInvalidSharedMemoryId, kSharedMemoryOffset, kSourceSize);
EXPECT_NE(error::kNoError, ExecuteCmd(cmd));
@@ -942,9 +954,11 @@
memcpy(GetImmediateDataAs<void*>(&cmd), kSource, kSourceSize);
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, kSourceSize));
EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
- cmd.Init(client_texture_id_, kSourceSize);
+#if GLES2_TEST_SHADER_VS_PROGRAM_IDS
+ cmd.Init(client_program_id_, kSourceSize);
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, kSourceSize));
EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
+#endif // GLES2_TEST_SHADER_VS_PROGRAM_IDS
}
TEST_F(GLES2DecoderTest, ShaderSourceBucketAndGetShaderSourceValidArgs) {
@@ -1908,7 +1922,7 @@
GL_UNSIGNED_SHORT,
kValidIndexRangeStart * 2, kSharedMemoryId, kSharedMemoryOffset);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
- EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
+ EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
cmd.Init(client_element_buffer_id_, kOutOfRangeIndexRangeEnd,
GL_UNSIGNED_SHORT,
kValidIndexRangeStart * 2, kSharedMemoryId, kSharedMemoryOffset);

Powered by Google App Engine
This is Rietveld 408576698