| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Tests for the Command Buffer Helper. | 5 // Tests for the Command Buffer Helper. |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 int flush_count_; | 78 int flush_count_; |
| 79 DISALLOW_COPY_AND_ASSIGN(CommandBufferServiceLocked); | 79 DISALLOW_COPY_AND_ASSIGN(CommandBufferServiceLocked); |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 // Test fixture for CommandBufferHelper test - Creates a CommandBufferHelper, | 82 // Test fixture for CommandBufferHelper test - Creates a CommandBufferHelper, |
| 83 // using a CommandBufferEngine with a mock AsyncAPIInterface for its interface | 83 // using a CommandBufferEngine with a mock AsyncAPIInterface for its interface |
| 84 // (calling it directly, not through the RPC mechanism). | 84 // (calling it directly, not through the RPC mechanism). |
| 85 class CommandBufferHelperTest : public testing::Test { | 85 class CommandBufferHelperTest : public testing::Test { |
| 86 protected: | 86 protected: |
| 87 virtual void SetUp() { | 87 virtual void SetUp() { |
| 88 api_mock_.reset(new AsyncAPIMock); | 88 api_mock_.reset(new AsyncAPIMock(true)); |
| 89 |
| 89 // ignore noops in the mock - we don't want to inspect the internals of the | 90 // ignore noops in the mock - we don't want to inspect the internals of the |
| 90 // helper. | 91 // helper. |
| 91 EXPECT_CALL(*api_mock_, DoCommand(cmd::kNoop, _, _)) | 92 EXPECT_CALL(*api_mock_, DoCommand(cmd::kNoop, _, _)) |
| 92 .WillRepeatedly(Return(error::kNoError)); | 93 .WillRepeatedly(Return(error::kNoError)); |
| 93 | 94 |
| 94 { | 95 { |
| 95 TransferBufferManager* manager = new TransferBufferManager(); | 96 TransferBufferManager* manager = new TransferBufferManager(); |
| 96 transfer_buffer_manager_.reset(manager); | 97 transfer_buffer_manager_.reset(manager); |
| 97 EXPECT_TRUE(manager->Initialize()); | 98 EXPECT_TRUE(manager->Initialize()); |
| 98 } | 99 } |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 helper_->Finish(); | 703 helper_->Finish(); |
| 703 | 704 |
| 704 // Check that the commands did happen. | 705 // Check that the commands did happen. |
| 705 Mock::VerifyAndClearExpectations(api_mock_.get()); | 706 Mock::VerifyAndClearExpectations(api_mock_.get()); |
| 706 | 707 |
| 707 // Check the error status. | 708 // Check the error status. |
| 708 EXPECT_EQ(error::kNoError, GetError()); | 709 EXPECT_EQ(error::kNoError, GetError()); |
| 709 } | 710 } |
| 710 | 711 |
| 711 } // namespace gpu | 712 } // namespace gpu |
| OLD | NEW |