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

Unified Diff: gpu/command_buffer/service/test_helper.cc

Issue 2291753002: Prevent crash when using getExtension while a PBO is bound. (Closed)
Patch Set: small corrections Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/test_helper.h ('k') | gpu/command_buffer/service/texture_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/test_helper.cc
diff --git a/gpu/command_buffer/service/test_helper.cc b/gpu/command_buffer/service/test_helper.cc
index b0714d9454784d63e1f88ae56bf0ca4d2ef87655..956ff3c608a4c407b16a6b225e24194eac0cf007 100644
--- a/gpu/command_buffer/service/test_helper.cc
+++ b/gpu/command_buffer/service/test_helper.cc
@@ -34,6 +34,7 @@ using ::testing::NotNull;
using ::testing::Return;
using ::testing::SetArrayArgument;
using ::testing::SetArgumentPointee;
+using ::testing::SetArgPointee;
using ::testing::StrEq;
using ::testing::StrictMock;
@@ -331,13 +332,17 @@ void TestHelper::SetupContextGroupInitExpectations(
const DisallowedFeatures& disallowed_features,
const char* extensions,
const char* gl_version,
+ ContextType context_type,
bool bind_generates_resource) {
InSequence sequence;
- SetupFeatureInfoInitExpectationsWithGLVersion(gl, extensions, "", gl_version);
-
gl::GLVersionInfo gl_info(gl_version, "", extensions);
+ SetupFeatureInfoInitExpectationsWithGLVersion(gl, extensions, "", gl_version,
+ context_type,
+ context_type == CONTEXT_TYPE_WEBGL2 ||
+ context_type == CONTEXT_TYPE_OPENGLES3);
+
EXPECT_CALL(*gl, GetIntegerv(GL_MAX_RENDERBUFFER_SIZE, _))
.WillOnce(SetArgumentPointee<1>(kMaxRenderbufferSize))
.RetiresOnSaturation();
@@ -468,7 +473,8 @@ void TestHelper::SetupContextGroupInitExpectations(
void TestHelper::SetupFeatureInfoInitExpectations(::gl::MockGLInterface* gl,
const char* extensions) {
- SetupFeatureInfoInitExpectationsWithGLVersion(gl, extensions, "", "");
+ SetupFeatureInfoInitExpectationsWithGLVersion(gl, extensions, "", "",
+ CONTEXT_TYPE_OPENGLES2);
}
void TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
@@ -476,6 +482,7 @@ void TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
const char* extensions,
const char* gl_renderer,
const char* gl_version,
+ ContextType context_type,
bool enable_es3) {
InSequence sequence;
@@ -514,6 +521,14 @@ void TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
.WillOnce(Return(reinterpret_cast<const uint8_t*>(gl_renderer)))
.RetiresOnSaturation();
+ if (!(context_type == CONTEXT_TYPE_WEBGL1 ||
+ context_type == CONTEXT_TYPE_OPENGLES2) &&
+ gl_info.is_es3_capable && enable_es3) {
+ EXPECT_CALL(*gl, GetIntegerv(GL_PIXEL_UNPACK_BUFFER_BINDING, _))
+ .WillOnce(SetArgPointee<1>(0))
+ .RetiresOnSaturation();
+ }
+
if ((strstr(extensions, "GL_ARB_texture_float") ||
gl_info.is_desktop_core_profile) ||
(gl_info.is_es3 && strstr(extensions, "GL_EXT_color_buffer_float"))) {
« no previous file with comments | « gpu/command_buffer/service/test_helper.h ('k') | gpu/command_buffer/service/texture_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698