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 <memory> |
| 6 |
5 #include "base/command_line.h" | 7 #include "base/command_line.h" |
6 #include "base/memory/scoped_ptr.h" | |
7 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
8 #include "ui/gl/gl_implementation.h" | 9 #include "ui/gl/gl_implementation.h" |
9 #include "ui/gl/gl_surface_wgl.h" | 10 #include "ui/gl/gl_surface_wgl.h" |
10 #include "ui/gl/gl_wgl_api_implementation.h" | 11 #include "ui/gl/gl_wgl_api_implementation.h" |
11 | 12 |
12 typedef std::pair<std::string, std::string> stringpair; | 13 typedef std::pair<std::string, std::string> stringpair; |
13 | 14 |
14 namespace gfx { | 15 namespace gfx { |
15 | 16 |
16 class WGLApiTest : public testing::Test { | 17 class WGLApiTest : public testing::Test { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 } | 74 } |
74 | 75 |
75 static const char* GL_BINDING_CALL FakeGetExtensionsStringEXT() { | 76 static const char* GL_BINDING_CALL FakeGetExtensionsStringEXT() { |
76 return fake_ext_extension_string_; | 77 return fake_ext_extension_string_; |
77 } | 78 } |
78 | 79 |
79 protected: | 80 protected: |
80 static const char* fake_ext_extension_string_; | 81 static const char* fake_ext_extension_string_; |
81 static const char* fake_arb_extension_string_; | 82 static const char* fake_arb_extension_string_; |
82 | 83 |
83 scoped_ptr<RealWGLApi> api_; | 84 std::unique_ptr<RealWGLApi> api_; |
84 }; | 85 }; |
85 | 86 |
86 const char* WGLApiTest::fake_ext_extension_string_ = ""; | 87 const char* WGLApiTest::fake_ext_extension_string_ = ""; |
87 const char* WGLApiTest::fake_arb_extension_string_ = ""; | 88 const char* WGLApiTest::fake_arb_extension_string_ = ""; |
88 | 89 |
89 TEST_F(WGLApiTest, DisabledExtensionBitTest) { | 90 TEST_F(WGLApiTest, DisabledExtensionBitTest) { |
90 static const char* kFakeExtensions = "WGL_ARB_extensions_string"; | 91 static const char* kFakeExtensions = "WGL_ARB_extensions_string"; |
91 static const char* kFakeDisabledExtensions = "WGL_ARB_extensions_string"; | 92 static const char* kFakeDisabledExtensions = "WGL_ARB_extensions_string"; |
92 | 93 |
93 InitializeAPI(nullptr); | 94 InitializeAPI(nullptr); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 InitializeAPI(nullptr); | 145 InitializeAPI(nullptr); |
145 EXPECT_EQ(stringpair(kFakeExtensions, kFakeExtensions), | 146 EXPECT_EQ(stringpair(kFakeExtensions, kFakeExtensions), |
146 GetExtensions()); | 147 GetExtensions()); |
147 | 148 |
148 InitializeAPI(&command_line); | 149 InitializeAPI(&command_line); |
149 EXPECT_EQ(stringpair(kFilteredExtensions, kFilteredExtensions), | 150 EXPECT_EQ(stringpair(kFilteredExtensions, kFilteredExtensions), |
150 GetExtensions()); | 151 GetExtensions()); |
151 } | 152 } |
152 | 153 |
153 } // namespace gfx | 154 } // namespace gfx |
OLD | NEW |