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

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

Issue 2291753002: Prevent crash when using getExtension while a PBO is bound. (Closed)
Patch Set: small corrections Created 4 years, 3 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
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); 98 gl_.get(), extensions, renderer, version, GetContextType());
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); 110 gl_.get(), extensions, renderer, version, GetContextType());
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); 122 gl_.get(), extensions, renderer, version, GetContextType());
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, "", ""); 139 gl_.get(), extensions, "", "", GetContextType());
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 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after
1552 EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_RG8_EXT)); 1552 EXPECT_TRUE(info_->validators()->render_buffer_format.IsValid(GL_RG8_EXT));
1553 } 1553 }
1554 1554
1555 TEST_P(FeatureInfoTest, InitializeCHROMIUM_ycbcr_422_imageTrue) { 1555 TEST_P(FeatureInfoTest, InitializeCHROMIUM_ycbcr_422_imageTrue) {
1556 SetupInitExpectations("GL_APPLE_ycbcr_422"); 1556 SetupInitExpectations("GL_APPLE_ycbcr_422");
1557 EXPECT_TRUE(info_->feature_flags().chromium_image_ycbcr_422); 1557 EXPECT_TRUE(info_->feature_flags().chromium_image_ycbcr_422);
1558 } 1558 }
1559 1559
1560 } // namespace gles2 1560 } // namespace gles2
1561 } // namespace gpu 1561 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/feature_info.cc ('k') | gpu/command_buffer/service/framebuffer_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698