Index: gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc |
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc |
index 6f74bde049790c3f6748fbf28102a5ff7bea346b..0b35b39c9dc941269b3d88a95cd0a62063a53fcd 100644 |
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc |
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc |
@@ -141,8 +141,21 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine( |
InSequence sequence; |
+ surface_ = new gfx::GLSurfaceStub; |
+ surface_->SetSize(gfx::Size(kBackBufferWidth, kBackBufferHeight)); |
+ |
+ // Context needs to be created before initializing ContextGroup, which will |
+ // in turn initialize FeatureInfo, which needs a context to determine |
+ // extension support. |
+ context_ = new gfx::GLContextStubWithExtensions; |
+ context_->AddExtensionsString(extensions); |
+ context_->SetGLVersionString(gl_version); |
+ |
+ context_->MakeCurrent(surface_.get()); |
+ gfx::GLSurface::InitializeDynamicMockBindingsForTests(context_); |
+ |
TestHelper::SetupContextGroupInitExpectations(gl_.get(), |
- DisallowedFeatures(), extensions); |
+ DisallowedFeatures(), extensions, gl_version); |
// We initialize the ContextGroup with a MockGLES2Decoder so that |
// we can use the ContextGroup to figure out how the real GLES2Decoder |
@@ -281,16 +294,6 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine( |
shared_memory_id_ = kSharedMemoryId; |
shared_memory_base_ = buffer.ptr; |
- surface_ = new gfx::GLSurfaceStub; |
- surface_->SetSize(gfx::Size(kBackBufferWidth, kBackBufferHeight)); |
- |
- context_ = new gfx::GLContextStubWithExtensions; |
- context_->AddExtensionsString(extensions); |
- context_->SetGLVersionString(gl_version); |
- |
- context_->MakeCurrent(surface_.get()); |
- gfx::GLSurface::InitializeDynamicMockBindingsForTests(context_); |
- |
int32 attributes[] = { |
EGL_ALPHA_SIZE, request_alpha ? 8 : 0, |
EGL_DEPTH_SIZE, request_depth ? 24 : 0, |
@@ -834,6 +837,28 @@ void GLES2DecoderTestBase::DoTexImage2D( |
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
} |
+void GLES2DecoderTestBase::DoTexImage2DConvertInternalFormat( |
+ GLenum target, GLint level, GLenum requested_internal_format, |
+ GLsizei width, GLsizei height, GLint border, |
+ GLenum format, GLenum type, |
+ uint32 shared_memory_id, uint32 shared_memory_offset, |
+ GLenum expected_internal_format) { |
+ EXPECT_CALL(*gl_, GetError()) |
+ .WillOnce(Return(GL_NO_ERROR)) |
+ .RetiresOnSaturation(); |
+ EXPECT_CALL(*gl_, TexImage2D(target, level, expected_internal_format, |
+ width, height, border, format, type, _)) |
+ .Times(1) |
+ .RetiresOnSaturation(); |
+ EXPECT_CALL(*gl_, GetError()) |
+ .WillOnce(Return(GL_NO_ERROR)) |
+ .RetiresOnSaturation(); |
+ cmds::TexImage2D cmd; |
+ cmd.Init(target, level, requested_internal_format, width, height, border, |
+ format, type, shared_memory_id, shared_memory_offset); |
+ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); |
+} |
+ |
void GLES2DecoderTestBase::DoCompressedTexImage2D( |
GLenum target, GLint level, GLenum format, |
GLsizei width, GLsizei height, GLint border, |