| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <memory> |
| 8 |
| 7 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include "ui/gl/gl_context.h" | 12 #include "ui/gl/gl_context.h" |
| 12 #include "ui/gl/gl_gl_api_implementation.h" | 13 #include "ui/gl/gl_gl_api_implementation.h" |
| 13 #include "ui/gl/gl_implementation.h" | 14 #include "ui/gl/gl_implementation.h" |
| 14 #include "ui/gl/gl_switches.h" | 15 #include "ui/gl/gl_switches.h" |
| 15 #include "ui/gl/gpu_timing.h" | 16 #include "ui/gl/gpu_timing.h" |
| 16 | 17 |
| 17 namespace gfx { | 18 namespace gfx { |
| 18 | 19 |
| 19 class GLContextFake : public GLContext { | 20 class GLContextFake : public GLContext { |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 } | 131 } |
| 131 | 132 |
| 132 protected: | 133 protected: |
| 133 static const char* fake_extension_string_; | 134 static const char* fake_extension_string_; |
| 134 static const char* fake_version_string_; | 135 static const char* fake_version_string_; |
| 135 | 136 |
| 136 static uint32_t num_fake_extension_strings_; | 137 static uint32_t num_fake_extension_strings_; |
| 137 static const char** fake_extension_strings_; | 138 static const char** fake_extension_strings_; |
| 138 | 139 |
| 139 scoped_refptr<GLContext> fake_context_; | 140 scoped_refptr<GLContext> fake_context_; |
| 140 scoped_ptr<DriverGL> driver_; | 141 std::unique_ptr<DriverGL> driver_; |
| 141 scoped_ptr<RealGLApi> api_; | 142 std::unique_ptr<RealGLApi> api_; |
| 142 }; | 143 }; |
| 143 | 144 |
| 144 const char* GLApiTest::fake_extension_string_ = ""; | 145 const char* GLApiTest::fake_extension_string_ = ""; |
| 145 const char* GLApiTest::fake_version_string_ = ""; | 146 const char* GLApiTest::fake_version_string_ = ""; |
| 146 | 147 |
| 147 uint32_t GLApiTest::num_fake_extension_strings_ = 0; | 148 uint32_t GLApiTest::num_fake_extension_strings_ = 0; |
| 148 const char** GLApiTest::fake_extension_strings_ = nullptr; | 149 const char** GLApiTest::fake_extension_strings_ = nullptr; |
| 149 | 150 |
| 150 TEST_F(GLApiTest, DisabledExtensionStringTest) { | 151 TEST_F(GLApiTest, DisabledExtensionStringTest) { |
| 151 static const char* kFakeExtensions = "GL_EXT_1 GL_EXT_2 GL_EXT_3 GL_EXT_4"; | 152 static const char* kFakeExtensions = "GL_EXT_1 GL_EXT_2 GL_EXT_3 GL_EXT_4"; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 kFakeDisabledExtensions); | 211 kFakeDisabledExtensions); |
| 211 InitializeAPI(&command_line); | 212 InitializeAPI(&command_line); |
| 212 | 213 |
| 213 EXPECT_EQ(arraysize(kFilteredExtensions), GetNumExtensions()); | 214 EXPECT_EQ(arraysize(kFilteredExtensions), GetNumExtensions()); |
| 214 for (uint32_t i = 0; i < arraysize(kFilteredExtensions); ++i) { | 215 for (uint32_t i = 0; i < arraysize(kFilteredExtensions); ++i) { |
| 215 EXPECT_STREQ(kFilteredExtensions[i], GetExtensioni(i)); | 216 EXPECT_STREQ(kFilteredExtensions[i], GetExtensioni(i)); |
| 216 } | 217 } |
| 217 } | 218 } |
| 218 | 219 |
| 219 } // namespace gfx | 220 } // namespace gfx |
| OLD | NEW |