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

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

Issue 660229: "/b/slave/chromium-rel-linux/build/src/gpu/command_buffer/client/gles2_demo_c... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 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/service/gles2_cmd_decoder_unittest.cc
===================================================================
--- gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc (revision 40197)
+++ gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc (working copy)
@@ -853,7 +853,6 @@
}
TEST_F(GLES2DecoderTest, ShaderSourceAndGetShaderSourceValidArgs) {
- const uint32 kBucketId = 123;
const char kSource[] = "hello";
const uint32 kSourceSize = sizeof(kSource) - 1;
memcpy(shared_memory_address_, kSource, kSourceSize);
@@ -862,14 +861,15 @@
kSharedMemoryId, kSharedMemoryOffset, kSourceSize);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
memset(shared_memory_address_, 0, kSourceSize);
+ // TODO(gman): GetShaderSource has to change format so result is always set.
GetShaderSource get_cmd;
- get_cmd.Init(client_shader_id_, kBucketId);
+ get_cmd.Init(client_shader_id_, kSourceSize + 1,
+ kSharedMemoryId, kSharedMemoryOffset,
+ kSharedMemoryId, kSharedMemoryOffset + sizeof(kSourceSize));
EXPECT_EQ(error::kNoError, ExecuteCmd(get_cmd));
- CommonDecoder::Bucket* bucket = decoder_->GetBucket(kBucketId);
- ASSERT_TRUE(bucket != NULL);
- EXPECT_EQ(kSourceSize + 1, bucket->size());
- EXPECT_EQ(0, memcmp(bucket->GetData(0, bucket->size()), kSource,
- bucket->size()));
+ EXPECT_EQ(kSourceSize, *GetSharedMemoryAs<uint32*>());
+ EXPECT_EQ(0, memcmp(GetSharedMemoryAsWithOffset<void*>(sizeof(kSourceSize)),
+ kSource, kSourceSize));
}
TEST_F(GLES2DecoderTest, ShaderSourceInvalidArgs) {
@@ -897,7 +897,6 @@
}
TEST_F(GLES2DecoderTest, ShaderSourceImmediateAndGetShaderSourceValidArgs) {
- const uint32 kBucketId = 123;
const char kSource[] = "hello";
const uint32 kSourceSize = sizeof(kSource) - 1;
ShaderSourceImmediate& cmd = *GetImmediateAs<ShaderSourceImmediate>();
@@ -907,13 +906,13 @@
memset(shared_memory_address_, 0, kSourceSize);
// TODO(gman): GetShaderSource has to change format so result is always set.
GetShaderSource get_cmd;
- get_cmd.Init(client_shader_id_, kBucketId);
+ get_cmd.Init(client_shader_id_, kSourceSize + 1,
+ kSharedMemoryId, kSharedMemoryOffset,
+ kSharedMemoryId, kSharedMemoryOffset + sizeof(kSourceSize));
EXPECT_EQ(error::kNoError, ExecuteCmd(get_cmd));
- CommonDecoder::Bucket* bucket = decoder_->GetBucket(kBucketId);
- ASSERT_TRUE(bucket != NULL);
- EXPECT_EQ(kSourceSize + 1, bucket->size());
- EXPECT_EQ(0, memcmp(bucket->GetData(0, bucket->size()), kSource,
- bucket->size()));
+ EXPECT_EQ(kSourceSize, *GetSharedMemoryAs<uint32*>());
+ EXPECT_EQ(0, memcmp(GetSharedMemoryAsWithOffset<void*>(sizeof(kSourceSize)),
+ kSource, kSourceSize));
}
TEST_F(GLES2DecoderTest, ShaderSourceImmediateInvalidArgs) {

Powered by Google App Engine
This is Rietveld 408576698