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) { |