| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/thread.h" | 5 #include "base/thread.h" |
| 6 #include "gpu/command_buffer/service/command_buffer_service.h" | 6 #include "gpu/command_buffer/service/command_buffer_service.h" |
| 7 #include "gpu/np_utils/np_browser_mock.h" | |
| 8 #include "gpu/np_utils/dynamic_np_object.h" | |
| 9 #include "gpu/np_utils/np_object_mock.h" | |
| 10 #include "gpu/np_utils/np_object_pointer.h" | |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 12 #include "testing/gmock/include/gmock/gmock.h" | 8 #include "testing/gmock/include/gmock/gmock.h" |
| 13 | 9 |
| 14 using base::SharedMemory; | 10 using base::SharedMemory; |
| 15 using np_utils::NPCreateObject; | |
| 16 using np_utils::NPObjectPointer; | |
| 17 using testing::_; | 11 using testing::_; |
| 18 using testing::DoAll; | 12 using testing::DoAll; |
| 19 using testing::Return; | 13 using testing::Return; |
| 20 using testing::SetArgumentPointee; | 14 using testing::SetArgumentPointee; |
| 21 using testing::StrictMock; | 15 using testing::StrictMock; |
| 22 | 16 |
| 23 namespace command_buffer { | 17 namespace command_buffer { |
| 24 | 18 |
| 25 class CommandBufferServiceTest : public testing::Test { | 19 class CommandBufferServiceTest : public testing::Test { |
| 26 protected: | 20 protected: |
| 27 virtual void SetUp() { | 21 virtual void SetUp() { |
| 28 command_buffer_.reset(new CommandBufferService); | 22 command_buffer_.reset(new CommandBufferService); |
| 29 } | 23 } |
| 30 | 24 |
| 31 np_utils::MockNPBrowser mock_browser_; | |
| 32 scoped_ptr<CommandBufferService> command_buffer_; | 25 scoped_ptr<CommandBufferService> command_buffer_; |
| 33 }; | 26 }; |
| 34 | 27 |
| 35 TEST_F(CommandBufferServiceTest, NullRingBufferByDefault) { | 28 TEST_F(CommandBufferServiceTest, NullRingBufferByDefault) { |
| 36 EXPECT_TRUE(NULL == command_buffer_->GetRingBuffer()); | 29 EXPECT_TRUE(NULL == command_buffer_->GetRingBuffer()); |
| 37 } | 30 } |
| 38 | 31 |
| 39 TEST_F(CommandBufferServiceTest, InitializesCommandBuffer) { | 32 TEST_F(CommandBufferServiceTest, InitializesCommandBuffer) { |
| 40 SharedMemory* ring_buffer = new SharedMemory; | 33 SharedMemory* ring_buffer = new SharedMemory; |
| 41 EXPECT_TRUE(ring_buffer->Create(std::wstring(), false, false, 1024)); | 34 EXPECT_TRUE(ring_buffer->Create(std::wstring(), false, false, 1024)); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 TEST_F(CommandBufferServiceTest, DefaultErrorStatusIsFalse) { | 169 TEST_F(CommandBufferServiceTest, DefaultErrorStatusIsFalse) { |
| 177 EXPECT_FALSE(command_buffer_->GetErrorStatus()); | 170 EXPECT_FALSE(command_buffer_->GetErrorStatus()); |
| 178 } | 171 } |
| 179 | 172 |
| 180 TEST_F(CommandBufferServiceTest, CanRaiseErrorStatus) { | 173 TEST_F(CommandBufferServiceTest, CanRaiseErrorStatus) { |
| 181 command_buffer_->RaiseErrorStatus(); | 174 command_buffer_->RaiseErrorStatus(); |
| 182 EXPECT_TRUE(command_buffer_->GetErrorStatus()); | 175 EXPECT_TRUE(command_buffer_->GetErrorStatus()); |
| 183 } | 176 } |
| 184 | 177 |
| 185 } // namespace command_buffer | 178 } // namespace command_buffer |
| OLD | NEW |