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

Side by Side Diff: gpu/command_buffer/tests/es3_misc_functions_unittest.cc

Issue 2471853002: remove 'unsafe' from ES3 apis in gpu process (Closed)
Patch Set: forgot to save file Created 4 years, 1 month 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
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 <GLES2/gl2.h> 5 #include <GLES2/gl2.h>
6 #include <GLES2/gl2ext.h> 6 #include <GLES2/gl2ext.h>
7 #include <GLES2/gl2extchromium.h> 7 #include <GLES2/gl2extchromium.h>
8 #include <GLES3/gl3.h> 8 #include <GLES3/gl3.h>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/strings/string_split.h" 11 #include "base/strings/string_split.h"
12 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
13 #include "gpu/command_buffer/tests/gl_manager.h" 13 #include "gpu/command_buffer/tests/gl_manager.h"
14 #include "gpu/command_buffer/tests/gl_test_utils.h" 14 #include "gpu/command_buffer/tests/gl_test_utils.h"
15 #include "testing/gmock/include/gmock/gmock.h" 15 #include "testing/gmock/include/gmock/gmock.h"
16 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
17 #include "ui/gl/gl_switches.h" 17 #include "ui/gl/gl_switches.h"
18 18
19 #define SHADER_VERSION_300(Src) "#version 300 es\n" #Src 19 #define SHADER_VERSION_300(Src) "#version 300 es\n" #Src
20 20
21 namespace gpu { 21 namespace gpu {
22 22
23 class OpenGLES3FunctionTest : public testing::Test { 23 class OpenGLES3FunctionTest : public testing::Test {
24 protected: 24 protected:
25 void SetUp() override { 25 void SetUp() override {
26 base::CommandLine command_line(*base::CommandLine::ForCurrentProcess()); 26 base::CommandLine command_line(*base::CommandLine::ForCurrentProcess());
27 command_line.AppendSwitch(switches::kEnableUnsafeES3APIs);
28 GLManager::Options options; 27 GLManager::Options options;
29 options.context_type = gles2::CONTEXT_TYPE_OPENGLES3; 28 options.context_type = gles2::CONTEXT_TYPE_OPENGLES3;
30 gl_.InitializeWithCommandLine(options, command_line); 29 gl_.InitializeWithCommandLine(options, command_line);
31 } 30 }
32 void TearDown() override { gl_.Destroy(); } 31 void TearDown() override { gl_.Destroy(); }
33 bool IsApplicable() const { return gl_.IsInitialized(); } 32 bool IsApplicable() const { return gl_.IsInitialized(); }
34 GLManager gl_; 33 GLManager gl_;
35 }; 34 };
36 35
37 #if defined(OS_ANDROID) 36 #if defined(OS_ANDROID)
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 extensions.end()); 104 extensions.end());
106 std::set<std::string> extensions_from_stringi; 105 std::set<std::string> extensions_from_stringi;
107 for (int i = 0; i < num_extensions; ++i) { 106 for (int i = 0; i < num_extensions; ++i) {
108 extensions_from_stringi.insert( 107 extensions_from_stringi.insert(
109 reinterpret_cast<const char*>(glGetStringi(GL_EXTENSIONS, i))); 108 reinterpret_cast<const char*>(glGetStringi(GL_EXTENSIONS, i)));
110 } 109 }
111 EXPECT_EQ(extensions_from_string, extensions_from_stringi); 110 EXPECT_EQ(extensions_from_string, extensions_from_stringi);
112 } 111 }
113 112
114 } // namespace gpu 113 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/texture_manager_unittest.cc ('k') | gpu/command_buffer/tests/fuzzer_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698