Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Side by Side Diff: ui/gl/egl_api_unittest.cc

Issue 2136553002: Remove GetPlatformDefaultEGLNativeDisplay() function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Back to original. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gl/BUILD.gn ('k') | ui/gl/generate_bindings.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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> 5 #include <memory>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "ui/gl/gl_egl_api_implementation.h" 9 #include "ui/gl/gl_egl_api_implementation.h"
10 #include "ui/gl/gl_surface_egl.h"
10 #include "ui/gl/gl_switches.h" 11 #include "ui/gl/gl_switches.h"
11 12
12 namespace gl { 13 namespace gl {
13 14
14 class EGLApiTest : public testing::Test { 15 class EGLApiTest : public testing::Test {
15 public: 16 public:
16 void SetUp() override { 17 void SetUp() override {
17 fake_client_extension_string_ = ""; 18 fake_client_extension_string_ = "";
18 fake_extension_string_ = ""; 19 fake_extension_string_ = "";
19 20
(...skipping 15 matching lines...) Expand all
35 fake_extension_string_ = ""; 36 fake_extension_string_ = "";
36 } 37 }
37 38
38 void InitializeAPI(base::CommandLine* command_line) { 39 void InitializeAPI(base::CommandLine* command_line) {
39 api_.reset(new RealEGLApi()); 40 api_.reset(new RealEGLApi());
40 g_current_egl_context = api_.get(); 41 g_current_egl_context = api_.get();
41 if (command_line) 42 if (command_line)
42 api_->InitializeWithCommandLine(&g_driver_egl, command_line); 43 api_->InitializeWithCommandLine(&g_driver_egl, command_line);
43 else 44 else
44 api_->Initialize(&g_driver_egl); 45 api_->Initialize(&g_driver_egl);
46 g_driver_egl.InitializeClientExtensionBindings();
47 GLSurfaceEGL::InitializeDisplay(EGL_DEFAULT_DISPLAY);
45 g_driver_egl.InitializeExtensionBindings(); 48 g_driver_egl.InitializeExtensionBindings();
46 } 49 }
47 50
48 void SetFakeExtensionString(const char* fake_string, 51 void SetFakeExtensionString(const char* fake_string,
49 const char* fake_client_string) { 52 const char* fake_client_string) {
50 fake_extension_string_ = fake_string; 53 fake_extension_string_ = fake_string;
51 fake_client_extension_string_ = fake_client_string; 54 fake_client_extension_string_ = fake_client_string;
52 } 55 }
53 56
54 static EGLBoolean GL_BINDING_CALL FakeInitialize(EGLDisplay display, 57 static EGLBoolean GL_BINDING_CALL FakeInitialize(EGLDisplay display,
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 base::CommandLine command_line(base::CommandLine::NO_PROGRAM); 135 base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
133 command_line.AppendSwitchASCII(switches::kDisableGLExtensions, 136 command_line.AppendSwitchASCII(switches::kDisableGLExtensions,
134 kFakeDisabledExtensions); 137 kFakeDisabledExtensions);
135 InitializeAPI(&command_line); 138 InitializeAPI(&command_line);
136 139
137 EXPECT_STREQ(kFilteredClientExtensions, GetExtensions().first); 140 EXPECT_STREQ(kFilteredClientExtensions, GetExtensions().first);
138 EXPECT_STREQ(kFilteredExtensions, GetExtensions().second); 141 EXPECT_STREQ(kFilteredExtensions, GetExtensions().second);
139 } 142 }
140 143
141 } // namespace gl 144 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/BUILD.gn ('k') | ui/gl/generate_bindings.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698