| 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 "o3d/gpu_plugin/command_buffer_mock.h" | 5 #include "o3d/gpu_plugin/command_buffer_mock.h" |
| 6 #include "o3d/gpu_plugin/gpu_plugin_object.h" | 6 #include "o3d/gpu_plugin/gpu_plugin_object.h" |
| 7 #include "o3d/gpu_plugin/np_utils/np_browser_mock.h" | 7 #include "o3d/gpu_plugin/np_utils/np_browser_mock.h" |
| 8 #include "o3d/gpu_plugin/np_utils/np_object_mock.h" | 8 #include "o3d/gpu_plugin/np_utils/np_object_mock.h" |
| 9 #include "o3d/gpu_plugin/np_utils/np_object_pointer.h" | 9 #include "o3d/gpu_plugin/np_utils/np_object_pointer.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 EXPECT_EQ(NPERR_GENERIC_ERROR, plugin_object_->SetWindow(&window)); | 99 EXPECT_EQ(NPERR_GENERIC_ERROR, plugin_object_->SetWindow(&window)); |
| 100 } | 100 } |
| 101 | 101 |
| 102 TEST_F(GPUPluginObjectTest, CanGetScriptableNPObject) { | 102 TEST_F(GPUPluginObjectTest, CanGetScriptableNPObject) { |
| 103 EXPECT_EQ(plugin_object_.Get(), plugin_object_->GetScriptableNPObject()); | 103 EXPECT_EQ(plugin_object_.Get(), plugin_object_->GetScriptableNPObject()); |
| 104 } | 104 } |
| 105 | 105 |
| 106 TEST_F(GPUPluginObjectTest, OpenCommandBufferReturnsInitializedCommandBuffer) { | 106 TEST_F(GPUPluginObjectTest, OpenCommandBufferReturnsInitializedCommandBuffer) { |
| 107 // Intercept creation of command buffer object and return mock. | 107 // Intercept creation of command buffer object and return mock. |
| 108 NPObjectPointer<MockCommandBuffer> command_buffer = | 108 NPObjectPointer<MockCommandBuffer> command_buffer = |
| 109 NPCreateObject<StrictMock<MockCommandBuffer> >(NULL); | 109 NPCreateObject<MockCommandBuffer>(NULL); |
| 110 EXPECT_CALL(mock_browser_, CreateObject(NULL, | 110 EXPECT_CALL(mock_browser_, CreateObject(NULL, |
| 111 NPGetClass<CommandBuffer>())) | 111 NPGetClass<CommandBuffer>())) |
| 112 .WillOnce(Return(command_buffer.ToReturned())); | 112 .WillOnce(Return(command_buffer.ToReturned())); |
| 113 | 113 |
| 114 EXPECT_CALL(*command_buffer.Get(), Initialize(1024)) | 114 EXPECT_CALL(*command_buffer.Get(), Initialize(1024)) |
| 115 .WillOnce(Return(true)); | 115 .WillOnce(Return(true)); |
| 116 | 116 |
| 117 EXPECT_CALL(*command_buffer.Get(), SetPutOffsetChangeCallback(NotNull())); | 117 EXPECT_CALL(*command_buffer.Get(), SetPutOffsetChangeCallback(NotNull())); |
| 118 | 118 |
| 119 EXPECT_EQ(NPERR_NO_ERROR, plugin_object_->New("application/foo", | 119 EXPECT_EQ(NPERR_NO_ERROR, plugin_object_->New("application/foo", |
| (...skipping 28 matching lines...) Expand all Loading... |
| 148 NULL, | 148 NULL, |
| 149 NULL, | 149 NULL, |
| 150 NULL)); | 150 NULL)); |
| 151 | 151 |
| 152 EXPECT_EQ(NPObjectPointer<NPObject>(), plugin_object_->OpenCommandBuffer()); | 152 EXPECT_EQ(NPObjectPointer<NPObject>(), plugin_object_->OpenCommandBuffer()); |
| 153 | 153 |
| 154 EXPECT_EQ(NPERR_NO_ERROR, plugin_object_->Destroy(NULL)); | 154 EXPECT_EQ(NPERR_NO_ERROR, plugin_object_->Destroy(NULL)); |
| 155 } | 155 } |
| 156 } // namespace gpu_plugin | 156 } // namespace gpu_plugin |
| 157 } // namespace o3d | 157 } // namespace o3d |
| OLD | NEW |