| Index: gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
|
| diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
|
| index 05fbcd89b56fdd2bcd49c62c371bc4f9e47f3399..b88322fc6fc72f6f090a20068358d7d07ed65201 100644
|
| --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
|
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc
|
| @@ -67,10 +67,6 @@ void GLES2DecoderRGBBackbufferTest::SetUp() {
|
| SetupDefaultProgram();
|
| }
|
|
|
| -// Override default setup so nothing gets setup.
|
| -void GLES2DecoderManualInitTest::SetUp() {
|
| -}
|
| -
|
| void GLES2DecoderManualInitTest::EnableDisableTest(GLenum cap,
|
| bool enable,
|
| bool expect_set) {
|
| @@ -90,16 +86,6 @@ void GLES2DecoderManualInitTest::EnableDisableTest(GLenum cap,
|
| }
|
| }
|
|
|
| -void GLES3DecoderTest::SetUp() {
|
| - base::CommandLine command_line(0, NULL);
|
| - command_line.AppendSwitch(switches::kEnableUnsafeES3APIs);
|
| - InitState init;
|
| - init.gl_version = "OpenGL ES 3.0";
|
| - init.bind_generates_resource = true;
|
| - init.context_type = CONTEXT_TYPE_OPENGLES3;
|
| - InitDecoderWithCommandLine(init, &command_line);
|
| -}
|
| -
|
|
|
| TEST_P(GLES3DecoderTest, Basic) {
|
| // Make sure the setup is correct for ES3.
|
| @@ -306,12 +292,9 @@ TEST_P(GLES3DecoderTest, GetInternalformativValidArgsSamples) {
|
| GetInternalformativ cmd;
|
| cmd.Init(GL_RENDERBUFFER, GL_RGBA8, GL_SAMPLES,
|
| shared_memory_id_, shared_memory_offset_);
|
| - decoder_->set_unsafe_es3_apis_enabled(true);
|
| EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| EXPECT_EQ(kNumSampleCounts, result->GetNumResults());
|
| EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| - decoder_->set_unsafe_es3_apis_enabled(false);
|
| - EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
|
| }
|
|
|
| TEST_P(GLES3DecoderTest, GetInternalformativValidArgsNumSampleCounts) {
|
| @@ -326,13 +309,10 @@ TEST_P(GLES3DecoderTest, GetInternalformativValidArgsNumSampleCounts) {
|
| GetInternalformativ cmd;
|
| cmd.Init(GL_RENDERBUFFER, GL_RGBA8, GL_NUM_SAMPLE_COUNTS,
|
| shared_memory_id_, shared_memory_offset_);
|
| - decoder_->set_unsafe_es3_apis_enabled(true);
|
| EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| EXPECT_EQ(1, result->GetNumResults());
|
| EXPECT_EQ(kNumSampleCounts, result->GetData()[0]);
|
| EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| - decoder_->set_unsafe_es3_apis_enabled(false);
|
| - EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
|
| }
|
|
|
| TEST_P(GLES3DecoderTest, ClientWaitSyncValid) {
|
| @@ -347,15 +327,12 @@ TEST_P(GLES3DecoderTest, ClientWaitSyncValid) {
|
| .WillOnce(Return(GL_CONDITION_SATISFIED))
|
| .RetiresOnSaturation();
|
| *result = GL_WAIT_FAILED;
|
| - decoder_->set_unsafe_es3_apis_enabled(true);
|
| EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| EXPECT_EQ(static_cast<GLenum>(GL_CONDITION_SATISFIED), *result);
|
| EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| - decoder_->set_unsafe_es3_apis_enabled(false);
|
| - EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
|
| }
|
|
|
| -TEST_P(GLES2DecoderTest, ClientWaitSyncNonZeroTimeoutValid) {
|
| +TEST_P(GLES3DecoderTest, ClientWaitSyncNonZeroTimeoutValid) {
|
| typedef ClientWaitSync::Result Result;
|
| Result* result = static_cast<Result*>(shared_memory_address_);
|
| ClientWaitSync cmd;
|
| @@ -368,19 +345,15 @@ TEST_P(GLES2DecoderTest, ClientWaitSyncNonZeroTimeoutValid) {
|
| .WillOnce(Return(GL_CONDITION_SATISFIED))
|
| .RetiresOnSaturation();
|
| *result = GL_WAIT_FAILED;
|
| - decoder_->set_unsafe_es3_apis_enabled(true);
|
| EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| EXPECT_EQ(static_cast<GLenum>(GL_CONDITION_SATISFIED), *result);
|
| EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| - decoder_->set_unsafe_es3_apis_enabled(false);
|
| - EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
|
| }
|
|
|
| -TEST_P(GLES2DecoderTest, ClientWaitSyncInvalidSyncFails) {
|
| +TEST_P(GLES3DecoderTest, ClientWaitSyncInvalidSyncFails) {
|
| typedef ClientWaitSync::Result Result;
|
| Result* result = static_cast<Result*>(shared_memory_address_);
|
| ClientWaitSync cmd;
|
| - decoder_->set_unsafe_es3_apis_enabled(true);
|
| cmd.Init(kInvalidClientId, GL_SYNC_FLUSH_COMMANDS_BIT, 0,
|
| shared_memory_id_, shared_memory_offset_);
|
| *result = GL_WAIT_FAILED;
|
| @@ -389,22 +362,20 @@ TEST_P(GLES2DecoderTest, ClientWaitSyncInvalidSyncFails) {
|
| EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
|
| }
|
|
|
| -TEST_P(GLES2DecoderTest, ClientWaitSyncResultNotInitFails) {
|
| +TEST_P(GLES3DecoderTest, ClientWaitSyncResultNotInitFails) {
|
| typedef ClientWaitSync::Result Result;
|
| Result* result = static_cast<Result*>(shared_memory_address_);
|
| ClientWaitSync cmd;
|
| - decoder_->set_unsafe_es3_apis_enabled(true);
|
| cmd.Init(client_sync_id_, GL_SYNC_FLUSH_COMMANDS_BIT, 0,
|
| shared_memory_id_, shared_memory_offset_);
|
| *result = 1; // Any value other than GL_WAIT_FAILED
|
| EXPECT_NE(error::kNoError, ExecuteCmd(cmd));
|
| }
|
|
|
| -TEST_P(GLES2DecoderTest, ClientWaitSyncBadSharedMemoryFails) {
|
| +TEST_P(GLES3DecoderTest, ClientWaitSyncBadSharedMemoryFails) {
|
| typedef ClientWaitSync::Result Result;
|
| Result* result = static_cast<Result*>(shared_memory_address_);
|
| ClientWaitSync cmd;
|
| - decoder_->set_unsafe_es3_apis_enabled(true);
|
| *result = GL_WAIT_FAILED;
|
| cmd.Init(client_sync_id_, GL_SYNC_FLUSH_COMMANDS_BIT, 0,
|
| kInvalidSharedMemoryId, shared_memory_offset_);
|
| @@ -416,7 +387,7 @@ TEST_P(GLES2DecoderTest, ClientWaitSyncBadSharedMemoryFails) {
|
| EXPECT_NE(error::kNoError, ExecuteCmd(cmd));
|
| }
|
|
|
| -TEST_P(GLES2DecoderTest, WaitSyncValidArgs) {
|
| +TEST_P(GLES3DecoderTest, WaitSyncValidArgs) {
|
| const GLuint64 kTimeout = GL_TIMEOUT_IGNORED;
|
| EXPECT_CALL(*gl_, WaitSync(reinterpret_cast<GLsync>(kServiceSyncId),
|
| 0, kTimeout))
|
| @@ -425,11 +396,8 @@ TEST_P(GLES2DecoderTest, WaitSyncValidArgs) {
|
|
|
| WaitSync cmd;
|
| cmd.Init(client_sync_id_, 0, kTimeout);
|
| - decoder_->set_unsafe_es3_apis_enabled(true);
|
| EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
|
| EXPECT_EQ(GL_NO_ERROR, GetGLError());
|
| - decoder_->set_unsafe_es3_apis_enabled(false);
|
| - EXPECT_EQ(error::kUnknownCommand, ExecuteCmd(cmd));
|
| }
|
|
|
| TEST_P(GLES2DecoderManualInitTest, BindGeneratesResourceFalse) {
|
| @@ -1719,7 +1687,7 @@ TEST_P(GLES2DecoderDescheduleUntilFinishedTest, NotYetSignalled) {
|
| EXPECT_EQ(0, reschedule_after_finished_callback_count_);
|
| }
|
|
|
| -void GLES3DecoderWithESSL3ShaderTest::SetUp() {
|
| +void GLES3DecoderTest::SetUp() {
|
| base::CommandLine command_line(0, nullptr);
|
| command_line.AppendSwitch(switches::kEnableUnsafeES3APIs);
|
| InitState init;
|
| @@ -1727,6 +1695,30 @@ void GLES3DecoderWithESSL3ShaderTest::SetUp() {
|
| init.bind_generates_resource = true;
|
| init.context_type = CONTEXT_TYPE_OPENGLES3;
|
| InitDecoderWithCommandLine(init, &command_line);
|
| +}
|
| +
|
| +void GLES3DecoderWithShaderTest::SetUp() {
|
| + base::CommandLine command_line(0, nullptr);
|
| + command_line.AppendSwitch(switches::kEnableUnsafeES3APIs);
|
| + InitState init;
|
| + init.gl_version = "OpenGL ES 3.0";
|
| + init.bind_generates_resource = true;
|
| + init.context_type = CONTEXT_TYPE_OPENGLES3;
|
| + InitDecoderWithCommandLine(init, &command_line);
|
| + SetupDefaultProgram();
|
| +}
|
| +
|
| +void GLES3DecoderRGBBackbufferTest::SetUp() {
|
| + base::CommandLine command_line(0, nullptr);
|
| + command_line.AppendSwitch(switches::kEnableUnsafeES3APIs);
|
| + command_line.AppendSwitchASCII(
|
| + switches::kGpuDriverBugWorkarounds,
|
| + base::IntToString(gpu::CLEAR_ALPHA_IN_READPIXELS));
|
| + InitState init;
|
| + init.gl_version = "OpenGL ES 3.0";
|
| + init.bind_generates_resource = true;
|
| + init.context_type = CONTEXT_TYPE_OPENGLES3;
|
| + InitDecoderWithCommandLine(init, &command_line);
|
| SetupDefaultProgram();
|
| }
|
|
|
| @@ -1748,8 +1740,12 @@ INSTANTIATE_TEST_CASE_P(Service,
|
|
|
| INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderTest, ::testing::Bool());
|
|
|
| +INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderWithShaderTest, ::testing::Bool());
|
| +
|
| +INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderManualInitTest, ::testing::Bool());
|
| +
|
| INSTANTIATE_TEST_CASE_P(Service,
|
| - GLES3DecoderWithESSL3ShaderTest,
|
| + GLES3DecoderRGBBackbufferTest,
|
| ::testing::Bool());
|
|
|
| } // namespace gles2
|
|
|