| 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 <memory> | 
 |    8  | 
|    8 #include "base/strings/string_number_conversions.h" |    9 #include "base/strings/string_number_conversions.h" | 
|    9 #include "base/strings/string_util.h" |   10 #include "base/strings/string_util.h" | 
|   10 #include "gpu/command_buffer/common/gles2_cmd_format.h" |   11 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 
|   11 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |   12 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 
|   12 #include "gpu/command_buffer/common/value_state.h" |   13 #include "gpu/command_buffer/common/value_state.h" | 
|   13 #include "gpu/command_buffer/service/common_decoder.h" |   14 #include "gpu/command_buffer/service/common_decoder.h" | 
|   14 #include "gpu/command_buffer/service/feature_info.h" |   15 #include "gpu/command_buffer/service/feature_info.h" | 
|   15 #include "gpu/command_buffer/service/gpu_service_test.h" |   16 #include "gpu/command_buffer/service/gpu_service_test.h" | 
|   16 #include "gpu/command_buffer/service/mocks.h" |   17 #include "gpu/command_buffer/service/mocks.h" | 
|   17 #include "gpu/command_buffer/service/test_helper.h" |   18 #include "gpu/command_buffer/service/test_helper.h" | 
| (...skipping 29 matching lines...) Expand all  Loading... | 
|   47     manager_->Destroy(); |   48     manager_->Destroy(); | 
|   48     subscription_ref_set_->RemoveObserver(&mock_observer_); |   49     subscription_ref_set_->RemoveObserver(&mock_observer_); | 
|   49     GpuServiceTest::TearDown(); |   50     GpuServiceTest::TearDown(); | 
|   50   } |   51   } | 
|   51  |   52  | 
|   52  protected: |   53  protected: | 
|   53   MockSubscriptionRefSetObserver mock_observer_; |   54   MockSubscriptionRefSetObserver mock_observer_; | 
|   54  |   55  | 
|   55   scoped_refptr<SubscriptionRefSet> subscription_ref_set_; |   56   scoped_refptr<SubscriptionRefSet> subscription_ref_set_; | 
|   56   scoped_refptr<ValueStateMap> pending_state_map_; |   57   scoped_refptr<ValueStateMap> pending_state_map_; | 
|   57   scoped_ptr<ValuebufferManager> manager_; |   58   std::unique_ptr<ValuebufferManager> manager_; | 
|   58 }; |   59 }; | 
|   59  |   60  | 
|   60 TEST_F(ValuebufferManagerTest, Basic) { |   61 TEST_F(ValuebufferManagerTest, Basic) { | 
|   61   const GLuint kClient1Id = 1; |   62   const GLuint kClient1Id = 1; | 
|   62   const GLuint kClient2Id = 2; |   63   const GLuint kClient2Id = 2; | 
|   63   // Check we can create a Valuebuffer |   64   // Check we can create a Valuebuffer | 
|   64   manager_->CreateValuebuffer(kClient1Id); |   65   manager_->CreateValuebuffer(kClient1Id); | 
|   65   Valuebuffer* valuebuffer0 = manager_->GetValuebuffer(kClient1Id); |   66   Valuebuffer* valuebuffer0 = manager_->GetValuebuffer(kClient1Id); | 
|   66   ASSERT_TRUE(valuebuffer0 != NULL); |   67   ASSERT_TRUE(valuebuffer0 != NULL); | 
|   67   EXPECT_EQ(kClient1Id, valuebuffer0->client_id()); |   68   EXPECT_EQ(kClient1Id, valuebuffer0->client_id()); | 
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  143   valuebuffer1->RemoveSubscription(GL_MOUSE_POSITION_CHROMIUM); |  144   valuebuffer1->RemoveSubscription(GL_MOUSE_POSITION_CHROMIUM); | 
|  144   // Ensure the manager still thinks a buffer has a reference to the |  145   // Ensure the manager still thinks a buffer has a reference to the | 
|  145   // subscription target. |  146   // subscription target. | 
|  146   EXPECT_CALL(mock_observer_, OnRemoveSubscription(GL_MOUSE_POSITION_CHROMIUM)) |  147   EXPECT_CALL(mock_observer_, OnRemoveSubscription(GL_MOUSE_POSITION_CHROMIUM)) | 
|  147       .Times(1); |  148       .Times(1); | 
|  148   valuebuffer2->RemoveSubscription(GL_MOUSE_POSITION_CHROMIUM); |  149   valuebuffer2->RemoveSubscription(GL_MOUSE_POSITION_CHROMIUM); | 
|  149 } |  150 } | 
|  150  |  151  | 
|  151 }  // namespace gles2 |  152 }  // namespace gles2 | 
|  152 }  // namespace gpu |  153 }  // namespace gpu | 
| OLD | NEW |