| OLD | NEW | 
|---|
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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/path_manager.h" | 5 #include "gpu/command_buffer/service/path_manager.h" | 
| 6 | 6 | 
| 7 #include "base/memory/scoped_ptr.h" | 7 #include <memory> | 
|  | 8 | 
| 8 #include "gpu/command_buffer/service/gpu_service_test.h" | 9 #include "gpu/command_buffer/service/gpu_service_test.h" | 
| 9 #include "gpu/command_buffer/service/mocks.h" | 10 #include "gpu/command_buffer/service/mocks.h" | 
| 10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" | 
| 11 #include "ui/gl/gl_mock.h" | 12 #include "ui/gl/gl_mock.h" | 
| 12 | 13 | 
| 13 namespace gpu { | 14 namespace gpu { | 
| 14 namespace gles2 { | 15 namespace gles2 { | 
| 15 | 16 | 
| 16 class PathManagerTest : public GpuServiceTest { | 17 class PathManagerTest : public GpuServiceTest { | 
| 17  public: | 18  public: | 
| 18   PathManagerTest() {} | 19   PathManagerTest() {} | 
| 19 | 20 | 
| 20  protected: | 21  protected: | 
| 21   void SetUp() override { | 22   void SetUp() override { | 
| 22     SetUpWithGLVersion("3.0", "GL_NV_path_rendering"); | 23     SetUpWithGLVersion("3.0", "GL_NV_path_rendering"); | 
| 23     manager_.reset(new PathManager()); | 24     manager_.reset(new PathManager()); | 
| 24   } | 25   } | 
| 25 | 26 | 
| 26   void TearDown() override { | 27   void TearDown() override { | 
| 27     manager_->Destroy(true); | 28     manager_->Destroy(true); | 
| 28     manager_.reset(); | 29     manager_.reset(); | 
| 29     GpuServiceTest::TearDown(); | 30     GpuServiceTest::TearDown(); | 
| 30   } | 31   } | 
| 31 | 32 | 
| 32   scoped_ptr<PathManager> manager_; | 33   std::unique_ptr<PathManager> manager_; | 
| 33 }; | 34 }; | 
| 34 | 35 | 
| 35 TEST_F(PathManagerTest, Basic) { | 36 TEST_F(PathManagerTest, Basic) { | 
| 36   const GLuint kClient1Id = 1; | 37   const GLuint kClient1Id = 1; | 
| 37   const GLuint kService1Id = 11; | 38   const GLuint kService1Id = 11; | 
| 38   const GLuint kClient2Id = 2; | 39   const GLuint kClient2Id = 2; | 
| 39   GLuint service_id = 0; | 40   GLuint service_id = 0; | 
| 40   manager_->CreatePathRange(kClient1Id, kClient1Id, kService1Id); | 41   manager_->CreatePathRange(kClient1Id, kClient1Id, kService1Id); | 
| 41   ASSERT_TRUE(manager_->HasPathsInRange(kClient1Id, kClient1Id)); | 42   ASSERT_TRUE(manager_->HasPathsInRange(kClient1Id, kClient1Id)); | 
| 42   EXPECT_TRUE(manager_->GetPath(kClient1Id, &service_id)); | 43   EXPECT_TRUE(manager_->GetPath(kClient1Id, &service_id)); | 
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 155                                   kSecondDeleteRange)).RetiresOnSaturation(); | 156                                   kSecondDeleteRange)).RetiresOnSaturation(); | 
| 156 | 157 | 
| 157   manager_->CreatePathRange(kFirstClientId1, kLastClientId1, kFirstServiceId1); | 158   manager_->CreatePathRange(kFirstClientId1, kLastClientId1, kFirstServiceId1); | 
| 158   manager_->CreatePathRange(kFirstClientId2, kLastClientId2, kFirstServiceId2); | 159   manager_->CreatePathRange(kFirstClientId2, kLastClientId2, kFirstServiceId2); | 
| 159   manager_->RemovePaths(0, std::numeric_limits<GLuint>::max()); | 160   manager_->RemovePaths(0, std::numeric_limits<GLuint>::max()); | 
| 160 } | 161 } | 
| 161 | 162 | 
| 162 }  // namespace gles2 | 163 }  // namespace gles2 | 
| 163 | 164 | 
| 164 }  // namespace gpu | 165 }  // namespace gpu | 
| OLD | NEW | 
|---|