| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "gpu/command_buffer/service/common_decoder.h" | 5 #include "gpu/command_buffer/service/common_decoder.h" |
| 6 #include "gpu/command_buffer/service/cmd_buffer_engine.h" | 6 #include "gpu/command_buffer/service/cmd_buffer_engine.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 namespace command_buffer { | 9 namespace gpu { |
| 10 | 10 |
| 11 TEST(CommonDecoderBucket, Basic) { | 11 TEST(CommonDecoderBucket, Basic) { |
| 12 CommonDecoder::Bucket bucket; | 12 CommonDecoder::Bucket bucket; |
| 13 EXPECT_EQ(0, bucket.size()); | 13 EXPECT_EQ(0, bucket.size()); |
| 14 EXPECT_TRUE(NULL == bucket.GetData(0, 0)); | 14 EXPECT_TRUE(NULL == bucket.GetData(0, 0)); |
| 15 } | 15 } |
| 16 | 16 |
| 17 TEST(CommonDecoderBucket, Size) { | 17 TEST(CommonDecoderBucket, Size) { |
| 18 CommonDecoder::Bucket bucket; | 18 CommonDecoder::Bucket bucket; |
| 19 bucket.SetSize(24); | 19 bucket.SetSize(24); |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 MockCommandBufferEngine::kValidShmId, kSomeOffsetInSharedMemory); | 407 MockCommandBufferEngine::kValidShmId, kSomeOffsetInSharedMemory); |
| 408 EXPECT_NE(parse_error::kParseNoError, ExecuteCmd(cmd)); | 408 EXPECT_NE(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 409 | 409 |
| 410 // Check that it fails if the size is invalid | 410 // Check that it fails if the size is invalid |
| 411 cmd.Init(kBucketId, 0, sizeof(kData) + 1, | 411 cmd.Init(kBucketId, 0, sizeof(kData) + 1, |
| 412 MockCommandBufferEngine::kValidShmId, kSomeOffsetInSharedMemory); | 412 MockCommandBufferEngine::kValidShmId, kSomeOffsetInSharedMemory); |
| 413 EXPECT_NE(parse_error::kParseNoError, ExecuteCmd(cmd)); | 413 EXPECT_NE(parse_error::kParseNoError, ExecuteCmd(cmd)); |
| 414 } | 414 } |
| 415 | 415 |
| 416 | 416 |
| 417 } // namespace command_buffer | 417 } // namespace gpu |
| 418 | 418 |
| OLD | NEW |