| 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_glx_api_implementation.h" | 9 #include "ui/gl/gl_glx_api_implementation.h" |
| 9 #include "ui/gl/gl_implementation.h" | 10 #include "ui/gl/gl_implementation.h" |
| 10 | 11 |
| 11 namespace gfx { | 12 namespace gfx { |
| 12 | 13 |
| 13 class GLXApiTest : public testing::Test { | 14 class GLXApiTest : public testing::Test { |
| 14 public: | 15 public: |
| 15 void SetUp() override { | 16 void SetUp() override { |
| 16 fake_extension_string_ = ""; | 17 fake_extension_string_ = ""; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 } | 65 } |
| 65 | 66 |
| 66 static const char* GL_BINDING_CALL FakeQueryExtensionsString(Display* dpy, | 67 static const char* GL_BINDING_CALL FakeQueryExtensionsString(Display* dpy, |
| 67 int screen) { | 68 int screen) { |
| 68 return fake_extension_string_; | 69 return fake_extension_string_; |
| 69 } | 70 } |
| 70 | 71 |
| 71 protected: | 72 protected: |
| 72 static const char* fake_extension_string_; | 73 static const char* fake_extension_string_; |
| 73 | 74 |
| 74 scoped_ptr<RealGLXApi> api_; | 75 std::unique_ptr<RealGLXApi> api_; |
| 75 }; | 76 }; |
| 76 | 77 |
| 77 const char* GLXApiTest::fake_extension_string_ = ""; | 78 const char* GLXApiTest::fake_extension_string_ = ""; |
| 78 | 79 |
| 79 TEST_F(GLXApiTest, DisabledExtensionBitTest) { | 80 TEST_F(GLXApiTest, DisabledExtensionBitTest) { |
| 80 static const char* kFakeExtensions = "GLX_ARB_create_context"; | 81 static const char* kFakeExtensions = "GLX_ARB_create_context"; |
| 81 static const char* kFakeDisabledExtensions = "GLX_ARB_create_context"; | 82 static const char* kFakeDisabledExtensions = "GLX_ARB_create_context"; |
| 82 | 83 |
| 83 SetFakeExtensionString(kFakeExtensions); | 84 SetFakeExtensionString(kFakeExtensions); |
| 84 InitializeAPI(nullptr); | 85 InitializeAPI(nullptr); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 107 | 108 |
| 108 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); | 109 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); |
| 109 command_line.AppendSwitchASCII(switches::kDisableGLExtensions, | 110 command_line.AppendSwitchASCII(switches::kDisableGLExtensions, |
| 110 kFakeDisabledExtensions); | 111 kFakeDisabledExtensions); |
| 111 InitializeAPI(&command_line); | 112 InitializeAPI(&command_line); |
| 112 | 113 |
| 113 EXPECT_STREQ(kFilteredExtensions, GetExtensions()); | 114 EXPECT_STREQ(kFilteredExtensions, GetExtensions()); |
| 114 } | 115 } |
| 115 | 116 |
| 116 } // namespace gfx | 117 } // namespace gfx |
| OLD | NEW |