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

Side by Side Diff: gpu/command_buffer/service/feature_info_unittest.cc

Issue 2443553002: Create correct GLES3 context for GLES3 unittest (Closed)
Patch Set: remove context_type since it is equivalent to enable_es3 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "gpu/command_buffer/service/feature_info.h" 5 #include "gpu/command_buffer/service/feature_info.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 default: 88 default:
89 NOTREACHED(); 89 NOTREACHED();
90 return CONTEXT_TYPE_OPENGLES2; 90 return CONTEXT_TYPE_OPENGLES2;
91 } 91 }
92 } 92 }
93 93
94 void SetupInitExpectationsWithGLVersion( 94 void SetupInitExpectationsWithGLVersion(
95 const char* extensions, const char* renderer, const char* version) { 95 const char* extensions, const char* renderer, const char* version) {
96 GpuServiceTest::SetUpWithGLVersion(version, extensions); 96 GpuServiceTest::SetUpWithGLVersion(version, extensions);
97 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( 97 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
98 gl_.get(), extensions, renderer, version, GetContextType()); 98 gl_.get(), extensions, renderer, version);
99 info_ = new FeatureInfo(); 99 info_ = new FeatureInfo();
100 info_->Initialize(GetContextType(), DisallowedFeatures()); 100 info_->Initialize(GetContextType(), DisallowedFeatures());
101 } 101 }
102 102
103 void SetupInitExpectationsWithGLVersionAndDisallowedFeatures( 103 void SetupInitExpectationsWithGLVersionAndDisallowedFeatures(
104 const char* extensions, 104 const char* extensions,
105 const char* renderer, 105 const char* renderer,
106 const char* version, 106 const char* version,
107 const DisallowedFeatures& disallowed_features) { 107 const DisallowedFeatures& disallowed_features) {
108 GpuServiceTest::SetUpWithGLVersion(version, extensions); 108 GpuServiceTest::SetUpWithGLVersion(version, extensions);
109 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( 109 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
110 gl_.get(), extensions, renderer, version, GetContextType()); 110 gl_.get(), extensions, renderer, version);
111 info_ = new FeatureInfo(); 111 info_ = new FeatureInfo();
112 info_->Initialize(GetContextType(), disallowed_features); 112 info_->Initialize(GetContextType(), disallowed_features);
113 } 113 }
114 114
115 void SetupInitExpectationsWithGLVersionAndCommandLine( 115 void SetupInitExpectationsWithGLVersionAndCommandLine(
116 const char* extensions, 116 const char* extensions,
117 const char* renderer, 117 const char* renderer,
118 const char* version, 118 const char* version,
119 const base::CommandLine& command_line) { 119 const base::CommandLine& command_line) {
120 GpuServiceTest::SetUpWithGLVersion(version, extensions); 120 GpuServiceTest::SetUpWithGLVersion(version, extensions);
121 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( 121 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
122 gl_.get(), extensions, renderer, version, GetContextType()); 122 gl_.get(), extensions, renderer, version);
123 GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line); 123 GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line);
124 info_ = new FeatureInfo(command_line, gpu_driver_bug_workaround); 124 info_ = new FeatureInfo(command_line, gpu_driver_bug_workaround);
125 info_->Initialize(GetContextType(), DisallowedFeatures()); 125 info_->Initialize(GetContextType(), DisallowedFeatures());
126 } 126 }
127 127
128 void SetupWithCommandLine(const base::CommandLine& command_line) { 128 void SetupWithCommandLine(const base::CommandLine& command_line) {
129 GpuServiceTest::SetUp(); 129 GpuServiceTest::SetUp();
130 GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line); 130 GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line);
131 info_ = new FeatureInfo(command_line, gpu_driver_bug_workaround); 131 info_ = new FeatureInfo(command_line, gpu_driver_bug_workaround);
132 } 132 }
133 133
134 void SetupInitExpectationsWithCommandLine( 134 void SetupInitExpectationsWithCommandLine(
135 const char* extensions, 135 const char* extensions,
136 const base::CommandLine& command_line) { 136 const base::CommandLine& command_line) {
137 GpuServiceTest::SetUpWithGLVersion("2.0", extensions); 137 GpuServiceTest::SetUpWithGLVersion("2.0", extensions);
138 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion( 138 TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
139 gl_.get(), extensions, "", "", GetContextType()); 139 gl_.get(), extensions, "", "");
140 GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line); 140 GpuDriverBugWorkarounds gpu_driver_bug_workaround(&command_line);
141 info_ = new FeatureInfo(command_line, gpu_driver_bug_workaround); 141 info_ = new FeatureInfo(command_line, gpu_driver_bug_workaround);
142 info_->Initialize(GetContextType(), DisallowedFeatures()); 142 info_->Initialize(GetContextType(), DisallowedFeatures());
143 } 143 }
144 144
145 void SetupWithoutInit() { 145 void SetupWithoutInit() {
146 GpuServiceTest::SetUp(); 146 GpuServiceTest::SetUp();
147 info_ = new FeatureInfo(); 147 info_ = new FeatureInfo();
148 } 148 }
149 149
(...skipping 1509 matching lines...) Expand 10 before | Expand all | Expand 10 after
1659 EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_RG8_EXT)); 1659 EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_RG8_EXT));
1660 } 1660 }
1661 1661
1662 TEST_P(FeatureInfoTest, InitializeCHROMIUM_ycbcr_422_imageTrue) { 1662 TEST_P(FeatureInfoTest, InitializeCHROMIUM_ycbcr_422_imageTrue) {
1663 SetupInitExpectations("GL_APPLE_ycbcr_422"); 1663 SetupInitExpectations("GL_APPLE_ycbcr_422");
1664 EXPECT_TRUE(info_->feature_flags().chromium_image_ycbcr_422); 1664 EXPECT_TRUE(info_->feature_flags().chromium_image_ycbcr_422);
1665 } 1665 }
1666 1666
1667 } // namespace gles2 1667 } // namespace gles2
1668 } // namespace gpu 1668 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698