Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/vertex_array_manager.h" | |
|
no sievers
2016/04/05 19:02:41
This should stay below.
Looks like the formatting
Mostyn Bramley-Moore
2016/04/05 21:35:32
Fixed.
| |
| 6 | |
| 5 #include <stdint.h> | 7 #include <stdint.h> |
| 6 | 8 |
| 7 #include "gpu/command_buffer/service/vertex_array_manager.h" | 9 #include <memory> |
| 8 #include "gpu/command_buffer/service/vertex_attrib_manager.h" | |
| 9 | 10 |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "gpu/command_buffer/service/feature_info.h" | 11 #include "gpu/command_buffer/service/feature_info.h" |
| 12 #include "gpu/command_buffer/service/gpu_service_test.h" | 12 #include "gpu/command_buffer/service/gpu_service_test.h" |
| 13 #include "gpu/command_buffer/service/test_helper.h" | 13 #include "gpu/command_buffer/service/test_helper.h" |
| 14 #include "gpu/command_buffer/service/vertex_attrib_manager.h" | |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 15 #include "ui/gl/gl_mock.h" | 16 #include "ui/gl/gl_mock.h" |
| 16 | 17 |
| 17 using ::testing::Pointee; | 18 using ::testing::Pointee; |
| 18 using ::testing::_; | 19 using ::testing::_; |
| 19 | 20 |
| 20 namespace gpu { | 21 namespace gpu { |
| 21 namespace gles2 { | 22 namespace gles2 { |
| 22 | 23 |
| 23 class VertexArrayManagerTest : public GpuServiceTest { | 24 class VertexArrayManagerTest : public GpuServiceTest { |
| 24 public: | 25 public: |
| 25 static const uint32_t kNumVertexAttribs = 8; | 26 static const uint32_t kNumVertexAttribs = 8; |
| 26 | 27 |
| 27 VertexArrayManagerTest() { | 28 VertexArrayManagerTest() { |
| 28 } | 29 } |
| 29 | 30 |
| 30 ~VertexArrayManagerTest() override {} | 31 ~VertexArrayManagerTest() override {} |
| 31 | 32 |
| 32 protected: | 33 protected: |
| 33 void SetUp() override { | 34 void SetUp() override { |
| 34 GpuServiceTest::SetUpWithGLVersion("2.1", "GL_ARB_vertex_array_object"); | 35 GpuServiceTest::SetUpWithGLVersion("2.1", "GL_ARB_vertex_array_object"); |
| 35 manager_.reset(new VertexArrayManager()); | 36 manager_.reset(new VertexArrayManager()); |
| 36 } | 37 } |
| 37 | 38 |
| 38 void TearDown() override { | 39 void TearDown() override { |
| 39 manager_.reset(); | 40 manager_.reset(); |
| 40 GpuServiceTest::TearDown(); | 41 GpuServiceTest::TearDown(); |
| 41 } | 42 } |
| 42 | 43 |
| 43 scoped_ptr<VertexArrayManager> manager_; | 44 std::unique_ptr<VertexArrayManager> manager_; |
| 44 }; | 45 }; |
| 45 | 46 |
| 46 // GCC requires these declarations, but MSVC requires they not be present | 47 // GCC requires these declarations, but MSVC requires they not be present |
| 47 #ifndef COMPILER_MSVC | 48 #ifndef COMPILER_MSVC |
| 48 const uint32_t VertexArrayManagerTest::kNumVertexAttribs; | 49 const uint32_t VertexArrayManagerTest::kNumVertexAttribs; |
| 49 #endif | 50 #endif |
| 50 | 51 |
| 51 TEST_F(VertexArrayManagerTest, Basic) { | 52 TEST_F(VertexArrayManagerTest, Basic) { |
| 52 const GLuint kClient1Id = 1; | 53 const GLuint kClient1Id = 1; |
| 53 const GLuint kService1Id = 11; | 54 const GLuint kService1Id = 11; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 92 manager.Destroy(true); | 93 manager.Destroy(true); |
| 93 // Check that resources got freed. | 94 // Check that resources got freed. |
| 94 info1 = manager.GetVertexAttribManager(kClient1Id); | 95 info1 = manager.GetVertexAttribManager(kClient1Id); |
| 95 ASSERT_TRUE(info1 == NULL); | 96 ASSERT_TRUE(info1 == NULL); |
| 96 } | 97 } |
| 97 | 98 |
| 98 } // namespace gles2 | 99 } // namespace gles2 |
| 99 } // namespace gpu | 100 } // namespace gpu |
| 100 | 101 |
| 101 | 102 |
| OLD | NEW |