| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 #include "ui/gl/gl_gl_api_implementation.h" | 8 #include "ui/gl/gl_gl_api_implementation.h" |
| 9 #include "ui/gl/gl_implementation.h" | 9 #include "ui/gl/gl_implementation.h" |
| 10 #include "ui/gl/gl_switches.h" | 10 #include "ui/gl/gl_switches.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 num_fake_extension_strings_ = 0; | 35 num_fake_extension_strings_ = 0; |
| 36 fake_extension_strings_ = nullptr; | 36 fake_extension_strings_ = nullptr; |
| 37 } | 37 } |
| 38 | 38 |
| 39 void InitializeAPI(base::CommandLine* command_line) { | 39 void InitializeAPI(base::CommandLine* command_line) { |
| 40 api_.reset(new RealGLApi()); | 40 api_.reset(new RealGLApi()); |
| 41 if (command_line) | 41 if (command_line) |
| 42 api_->InitializeWithCommandLine(driver_.get(), command_line); | 42 api_->InitializeWithCommandLine(driver_.get(), command_line); |
| 43 else | 43 else |
| 44 api_->Initialize(driver_.get()); | 44 api_->Initialize(driver_.get()); |
| 45 api_->InitializeWithContext(); |
| 45 } | 46 } |
| 46 | 47 |
| 47 void SetFakeExtensionString(const char* fake_string) { | 48 void SetFakeExtensionString(const char* fake_string) { |
| 48 SetGLImplementation(kGLImplementationDesktopGL); | 49 SetGLImplementation(kGLImplementationDesktopGL); |
| 49 fake_extension_string_ = fake_string; | 50 fake_extension_string_ = fake_string; |
| 50 } | 51 } |
| 51 | 52 |
| 52 void SetFakeExtensionStrings(const char** fake_strings, uint32_t count) { | 53 void SetFakeExtensionStrings(const char** fake_strings, uint32_t count) { |
| 53 SetGLImplementation(kGLImplementationDesktopGLCoreProfile); | 54 SetGLImplementation(kGLImplementationDesktopGLCoreProfile); |
| 54 num_fake_extension_strings_ = count; | 55 num_fake_extension_strings_ = count; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 kFakeDisabledExtensions); | 145 kFakeDisabledExtensions); |
| 145 InitializeAPI(&command_line); | 146 InitializeAPI(&command_line); |
| 146 | 147 |
| 147 EXPECT_EQ(arraysize(kFilteredExtensions), GetNumExtensions()); | 148 EXPECT_EQ(arraysize(kFilteredExtensions), GetNumExtensions()); |
| 148 for (uint32_t i = 0; i < arraysize(kFilteredExtensions); ++i) { | 149 for (uint32_t i = 0; i < arraysize(kFilteredExtensions); ++i) { |
| 149 EXPECT_STREQ(kFilteredExtensions[i], GetExtensioni(i)); | 150 EXPECT_STREQ(kFilteredExtensions[i], GetExtensioni(i)); |
| 150 } | 151 } |
| 151 } | 152 } |
| 152 | 153 |
| 153 } // namespace gpu | 154 } // namespace gpu |
| OLD | NEW |