| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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/valuebuffer_manager.h" | 5 #include "gpu/command_buffer/service/valuebuffer_manager.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 10 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 class MockSubscriptionRefSetObserver : public SubscriptionRefSet::Observer { | 26 class MockSubscriptionRefSetObserver : public SubscriptionRefSet::Observer { |
| 27 public: | 27 public: |
| 28 MOCK_METHOD1(OnAddSubscription, void(unsigned int target)); | 28 MOCK_METHOD1(OnAddSubscription, void(unsigned int target)); |
| 29 MOCK_METHOD1(OnRemoveSubscription, void(unsigned int target)); | 29 MOCK_METHOD1(OnRemoveSubscription, void(unsigned int target)); |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 class ValuebufferManagerTest : public GpuServiceTest { | 32 class ValuebufferManagerTest : public GpuServiceTest { |
| 33 public: | 33 public: |
| 34 ValuebufferManagerTest() {} | 34 ValuebufferManagerTest() {} |
| 35 ~ValuebufferManagerTest() {} | 35 ~ValuebufferManagerTest() override {} |
| 36 | 36 |
| 37 void SetUp() override { | 37 void SetUp() override { |
| 38 GpuServiceTest::SetUp(); | 38 GpuServiceTest::SetUp(); |
| 39 subscription_ref_set_ = new SubscriptionRefSet(); | 39 subscription_ref_set_ = new SubscriptionRefSet(); |
| 40 pending_state_map_ = new ValueStateMap(); | 40 pending_state_map_ = new ValueStateMap(); |
| 41 subscription_ref_set_->AddObserver(&mock_observer_); | 41 subscription_ref_set_->AddObserver(&mock_observer_); |
| 42 manager_.reset(new ValuebufferManager(subscription_ref_set_.get(), | 42 manager_.reset(new ValuebufferManager(subscription_ref_set_.get(), |
| 43 pending_state_map_.get())); | 43 pending_state_map_.get())); |
| 44 } | 44 } |
| 45 | 45 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 valuebuffer1->RemoveSubscription(GL_MOUSE_POSITION_CHROMIUM); | 143 valuebuffer1->RemoveSubscription(GL_MOUSE_POSITION_CHROMIUM); |
| 144 // Ensure the manager still thinks a buffer has a reference to the | 144 // Ensure the manager still thinks a buffer has a reference to the |
| 145 // subscription target. | 145 // subscription target. |
| 146 EXPECT_CALL(mock_observer_, OnRemoveSubscription(GL_MOUSE_POSITION_CHROMIUM)) | 146 EXPECT_CALL(mock_observer_, OnRemoveSubscription(GL_MOUSE_POSITION_CHROMIUM)) |
| 147 .Times(1); | 147 .Times(1); |
| 148 valuebuffer2->RemoveSubscription(GL_MOUSE_POSITION_CHROMIUM); | 148 valuebuffer2->RemoveSubscription(GL_MOUSE_POSITION_CHROMIUM); |
| 149 } | 149 } |
| 150 | 150 |
| 151 } // namespace gles2 | 151 } // namespace gles2 |
| 152 } // namespace gpu | 152 } // namespace gpu |
| OLD | NEW |