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 "o3d/gpu_plugin/command_buffer.h" | 6 #include "o3d/gpu_plugin/command_buffer.h" |
7 #include "o3d/gpu_plugin/np_utils/dynamic_np_object.h" | 7 #include "o3d/gpu_plugin/np_utils/dynamic_np_object.h" |
8 #include "o3d/gpu_plugin/np_utils/np_browser_mock.h" | 8 #include "o3d/gpu_plugin/np_utils/np_browser_mock.h" |
9 #include "o3d/gpu_plugin/np_utils/np_object_mock.h" | 9 #include "o3d/gpu_plugin/np_utils/np_object_mock.h" |
10 #include "o3d/gpu_plugin/np_utils/np_object_pointer.h" | 10 #include "o3d/gpu_plugin/np_utils/np_object_pointer.h" |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 EXPECT_EQ(1, command_buffer_->RegisterObject(window_object_)); | 229 EXPECT_EQ(1, command_buffer_->RegisterObject(window_object_)); |
230 EXPECT_EQ(window_object_, command_buffer_->GetRegisteredObject(1)); | 230 EXPECT_EQ(window_object_, command_buffer_->GetRegisteredObject(1)); |
231 EXPECT_EQ(2, command_buffer_->RegisterObject(window_object_)); | 231 EXPECT_EQ(2, command_buffer_->RegisterObject(window_object_)); |
232 EXPECT_EQ(window_object_, command_buffer_->GetRegisteredObject(2)); | 232 EXPECT_EQ(window_object_, command_buffer_->GetRegisteredObject(2)); |
233 command_buffer_->UnregisterObject(window_object_, 2); | 233 command_buffer_->UnregisterObject(window_object_, 2); |
234 command_buffer_->UnregisterObject(window_object_, 1); | 234 command_buffer_->UnregisterObject(window_object_, 1); |
235 EXPECT_EQ(1, command_buffer_->RegisterObject(window_object_)); | 235 EXPECT_EQ(1, command_buffer_->RegisterObject(window_object_)); |
236 EXPECT_EQ(window_object_, command_buffer_->GetRegisteredObject(1)); | 236 EXPECT_EQ(window_object_, command_buffer_->GetRegisteredObject(1)); |
237 } | 237 } |
238 | 238 |
| 239 TEST_F(CommandBufferTest, DefaultTokenIsZero) { |
| 240 EXPECT_EQ(0, command_buffer_->GetToken()); |
| 241 } |
| 242 |
| 243 TEST_F(CommandBufferTest, CanSetToken) { |
| 244 command_buffer_->SetToken(7); |
| 245 EXPECT_EQ(7, command_buffer_->GetToken()); |
| 246 } |
| 247 |
| 248 TEST_F(CommandBufferTest, DefaultErrorIsNoError) { |
| 249 EXPECT_EQ(CommandBuffer::ERROR_NO_ERROR, command_buffer_->ResetError()); |
| 250 } |
| 251 |
| 252 TEST_F(CommandBufferTest, CanSetAndResetError) { |
| 253 command_buffer_->SetError(CommandBuffer::ERROR_UNKNOWN_COMMAND); |
| 254 EXPECT_EQ(CommandBuffer::ERROR_UNKNOWN_COMMAND, |
| 255 command_buffer_->ResetError()); |
| 256 EXPECT_EQ(CommandBuffer::ERROR_NO_ERROR, command_buffer_->ResetError()); |
| 257 } |
| 258 |
239 } // namespace gpu_plugin | 259 } // namespace gpu_plugin |
240 } // namespace o3d | 260 } // namespace o3d |
OLD | NEW |