| 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 3de75d5a223ef0c8b43f7b2f5d9ef8e75ced20ca..2eff474ac371b037af097ea8c84a53b5b4165937 100644
|
| --- a/gpu/command_buffer/service/test_helper.cc
|
| +++ b/gpu/command_buffer/service/test_helper.cc
|
| @@ -4,11 +4,15 @@
|
|
|
| #include "gpu/command_buffer/service/test_helper.h"
|
|
|
| +#include "base/string_tokenizer.h"
|
| #include "gpu/command_buffer/common/gl_mock.h"
|
| #include "gpu/command_buffer/common/types.h"
|
| +#include "gpu/command_buffer/service/gl_utils.h"
|
| #include "gpu/GLES2/gles2_command_buffer.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| +#include <string.h>
|
| +
|
| using ::testing::_;
|
| using ::testing::DoAll;
|
| using ::testing::InSequence;
|
| @@ -29,6 +33,8 @@ const GLuint TestHelper::kServiceBlackTexture2dId;
|
| const GLuint TestHelper::kServiceBlackTextureCubemapId;
|
| const GLuint TestHelper::kServiceDefaultTexture2dId;
|
| const GLuint TestHelper::kServiceDefaultTextureCubemapId;
|
| +const GLuint TestHelper::kServiceDefaultExternalTextureId;
|
| +const GLuint TestHelper::kServiceBlackExternalTextureId;
|
|
|
| const GLint TestHelper::kMaxRenderbufferSize;
|
| const GLint TestHelper::kMaxTextureSize;
|
| @@ -46,7 +52,8 @@ const GLint TestHelper::kMaxVertexUniformComponents;
|
| #endif
|
|
|
| void TestHelper::SetupTextureManagerInitExpectations(
|
| - ::gfx::MockGLInterface* gl) {
|
| + ::gfx::MockGLInterface* gl,
|
| + const char* extensions) {
|
| static GLuint texture_ids[] = {
|
| kServiceBlackTexture2dId,
|
| kServiceDefaultTexture2dId,
|
| @@ -89,6 +96,30 @@ void TestHelper::SetupTextureManagerInitExpectations(
|
| EXPECT_CALL(*gl, BindTexture(GL_TEXTURE_CUBE_MAP, 0))
|
| .Times(1)
|
| .RetiresOnSaturation();
|
| +
|
| + bool ext_image_external = false;
|
| + CStringTokenizer t(extensions, extensions + strlen(extensions), " ");
|
| + while (t.GetNext()) {
|
| + if (t.token() == "GL_OES_EGL_image_external") {
|
| + ext_image_external = true;
|
| + break;
|
| + }
|
| + }
|
| +
|
| + if (ext_image_external) {
|
| + static GLuint external_texture_ids[] = {
|
| + kServiceDefaultExternalTextureId,
|
| + kServiceBlackExternalTextureId,
|
| + };
|
| + EXPECT_CALL(*gl, GenTextures(arraysize(external_texture_ids), _))
|
| + .WillOnce(SetArrayArgument<1>(
|
| + external_texture_ids,
|
| + external_texture_ids + arraysize(external_texture_ids)))
|
| + .RetiresOnSaturation();
|
| + EXPECT_CALL(*gl, BindTexture(GL_TEXTURE_EXTERNAL_OES, 0))
|
| + .Times(1)
|
| + .RetiresOnSaturation();
|
| + }
|
| }
|
|
|
| void TestHelper::SetupContextGroupInitExpectations(
|
| @@ -131,7 +162,7 @@ void TestHelper::SetupContextGroupInitExpectations(
|
| .WillOnce(SetArgumentPointee<1>(kMaxVertexUniformComponents))
|
| .RetiresOnSaturation();
|
|
|
| - SetupTextureManagerInitExpectations(gl);
|
| + SetupTextureManagerInitExpectations(gl, extensions);
|
| }
|
|
|
| void TestHelper::SetupFeatureInfoInitExpectations(
|
|
|