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

Unified Diff: gpu/command_buffer/service/test_helper.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 side-by-side diff with in-line comments
Download patch
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 89224142d9d653ecc0d4fe50762c2d901dfeab8a..de4562a19f6b03da81aec8d05d9e731884693872 100644
--- a/gpu/command_buffer/service/test_helper.cc
+++ b/gpu/command_buffer/service/test_helper.cc
@@ -346,7 +346,6 @@ void TestHelper::SetupContextGroupInitExpectations(
gl::GLVersionInfo gl_info(gl_version, "", extensions);
SetupFeatureInfoInitExpectationsWithGLVersion(gl, extensions, "", gl_version,
- context_type,
context_type == CONTEXT_TYPE_WEBGL2 ||
context_type == CONTEXT_TYPE_OPENGLES3);
@@ -480,8 +479,7 @@ void TestHelper::SetupContextGroupInitExpectations(
void TestHelper::SetupFeatureInfoInitExpectations(::gl::MockGLInterface* gl,
const char* extensions) {
- SetupFeatureInfoInitExpectationsWithGLVersion(gl, extensions, "", "",
- CONTEXT_TYPE_OPENGLES2);
+ SetupFeatureInfoInitExpectationsWithGLVersion(gl, extensions, "", "");
}
void TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
@@ -489,7 +487,6 @@ void TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
const char* extensions,
const char* gl_renderer,
const char* gl_version,
- ContextType context_type,
bool enable_es3) {
InSequence sequence;
@@ -528,9 +525,7 @@ 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) {
+ if (gl_info.is_es3_capable && enable_es3) {
EXPECT_CALL(*gl, GetIntegerv(GL_PIXEL_UNPACK_BUFFER_BINDING, _))
.WillOnce(SetArgPointee<1>(0))
.RetiresOnSaturation();
@@ -575,6 +570,7 @@ void TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER))
.WillOnce(Return(GL_FRAMEBUFFER_COMPLETE))
.RetiresOnSaturation();
+ GLenum status_rgba = GL_FRAMEBUFFER_COMPLETE;
EXPECT_CALL(*gl, TexImage2D(GL_TEXTURE_2D, 0, GL_RGB32F, width, width, 0,
GL_RGB, GL_FLOAT, _))
.Times(1)
@@ -587,7 +583,9 @@ void TestHelper::SetupFeatureInfoInitExpectationsWithGLVersion(
EXPECT_CALL(*gl, CheckFramebufferStatusEXT(GL_FRAMEBUFFER))
.WillOnce(Return(GL_FRAMEBUFFER_COMPLETE))
.RetiresOnSaturation();
+ }
+ if (status_rgba == GL_FRAMEBUFFER_COMPLETE) {
if (enable_es3 && gl_info.is_es3_capable) {
EXPECT_CALL(*gl, TexImage2D(GL_TEXTURE_2D, 0, GL_R16F, width, width,
0, GL_RED, GL_FLOAT, _))

Powered by Google App Engine
This is Rietveld 408576698