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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc

Issue 2444813002: Remove unsafe mode to enable es3 api by default for WebGL2 and ES3 context (Closed)
Patch Set: fix a bug 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 Disable cmd; 82 Disable cmd;
83 cmd.Init(cap); 83 cmd.Init(cap);
84 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 84 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
85 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 85 EXPECT_EQ(GL_NO_ERROR, GetGLError());
86 } 86 }
87 } 87 }
88 88
89 89
90 TEST_P(GLES3DecoderTest, Basic) { 90 TEST_P(GLES3DecoderTest, Basic) {
91 // Make sure the setup is correct for ES3. 91 // Make sure the setup is correct for ES3.
92 EXPECT_TRUE(decoder_->unsafe_es3_apis_enabled()); 92 EXPECT_TRUE(decoder_->es3_apis_enabled());
93 EXPECT_TRUE(feature_info()->validators()->texture_bind_target.IsValid( 93 EXPECT_TRUE(feature_info()->validators()->texture_bind_target.IsValid(
94 GL_TEXTURE_3D)); 94 GL_TEXTURE_3D));
95 } 95 }
96 96
97 TEST_P(GLES2DecoderTest, InvalidCommand) { 97 TEST_P(GLES2DecoderTest, InvalidCommand) {
98 cmd::Noop cmd; 98 cmd::Noop cmd;
99 cmd.header.Init(gles2::kNumCommands, 1); 99 cmd.header.Init(gles2::kNumCommands, 1);
100 EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, 0)); 100 EXPECT_EQ(error::kUnknownCommand, ExecuteImmediateCmd(cmd, 0));
101 } 101 }
102 102
(...skipping 1579 matching lines...) Expand 10 before | Expand all | Expand 10 after
1682 EXPECT_EQ(0, deschedule_until_finished_callback_count_); 1682 EXPECT_EQ(0, deschedule_until_finished_callback_count_);
1683 EXPECT_EQ(0, reschedule_after_finished_callback_count_); 1683 EXPECT_EQ(0, reschedule_after_finished_callback_count_);
1684 1684
1685 EXPECT_EQ(error::kDeferLaterCommands, ExecuteCmd(cmd)); 1685 EXPECT_EQ(error::kDeferLaterCommands, ExecuteCmd(cmd));
1686 EXPECT_EQ(1, deschedule_until_finished_callback_count_); 1686 EXPECT_EQ(1, deschedule_until_finished_callback_count_);
1687 EXPECT_EQ(0, reschedule_after_finished_callback_count_); 1687 EXPECT_EQ(0, reschedule_after_finished_callback_count_);
1688 } 1688 }
1689 1689
1690 void GLES3DecoderTest::SetUp() { 1690 void GLES3DecoderTest::SetUp() {
1691 base::CommandLine command_line(0, nullptr); 1691 base::CommandLine command_line(0, nullptr);
1692 command_line.AppendSwitch(switches::kEnableUnsafeES3APIs);
1693 InitState init; 1692 InitState init;
1694 init.gl_version = "OpenGL ES 3.0"; 1693 init.gl_version = "OpenGL ES 3.0";
1695 init.bind_generates_resource = true; 1694 init.bind_generates_resource = true;
1696 init.context_type = CONTEXT_TYPE_OPENGLES3; 1695 init.context_type = CONTEXT_TYPE_OPENGLES3;
1697 InitDecoderWithCommandLine(init, &command_line); 1696 InitDecoderWithCommandLine(init, &command_line);
1698 } 1697 }
1699 1698
1700 void GLES3DecoderWithShaderTest::SetUp() { 1699 void GLES3DecoderWithShaderTest::SetUp() {
1701 base::CommandLine command_line(0, nullptr); 1700 base::CommandLine command_line(0, nullptr);
1702 command_line.AppendSwitch(switches::kEnableUnsafeES3APIs);
1703 InitState init; 1701 InitState init;
1704 init.gl_version = "OpenGL ES 3.0"; 1702 init.gl_version = "OpenGL ES 3.0";
1705 init.bind_generates_resource = true; 1703 init.bind_generates_resource = true;
1706 init.context_type = CONTEXT_TYPE_OPENGLES3; 1704 init.context_type = CONTEXT_TYPE_OPENGLES3;
1707 InitDecoderWithCommandLine(init, &command_line); 1705 InitDecoderWithCommandLine(init, &command_line);
1708 SetupDefaultProgram(); 1706 SetupDefaultProgram();
1709 } 1707 }
1710 1708
1711 void GLES3DecoderRGBBackbufferTest::SetUp() { 1709 void GLES3DecoderRGBBackbufferTest::SetUp() {
1712 base::CommandLine command_line(0, nullptr); 1710 base::CommandLine command_line(0, nullptr);
1713 command_line.AppendSwitch(switches::kEnableUnsafeES3APIs);
1714 command_line.AppendSwitchASCII( 1711 command_line.AppendSwitchASCII(
1715 switches::kGpuDriverBugWorkarounds, 1712 switches::kGpuDriverBugWorkarounds,
1716 base::IntToString(gpu::CLEAR_ALPHA_IN_READPIXELS)); 1713 base::IntToString(gpu::CLEAR_ALPHA_IN_READPIXELS));
1717 InitState init; 1714 InitState init;
1718 init.gl_version = "OpenGL ES 3.0"; 1715 init.gl_version = "OpenGL ES 3.0";
1719 init.bind_generates_resource = true; 1716 init.bind_generates_resource = true;
1720 init.context_type = CONTEXT_TYPE_OPENGLES3; 1717 init.context_type = CONTEXT_TYPE_OPENGLES3;
1721 InitDecoderWithCommandLine(init, &command_line); 1718 InitDecoderWithCommandLine(init, &command_line);
1722 SetupDefaultProgram(); 1719 SetupDefaultProgram();
1723 } 1720 }
(...skipping 19 matching lines...) Expand all
1743 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderWithShaderTest, ::testing::Bool()); 1740 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderWithShaderTest, ::testing::Bool());
1744 1741
1745 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderManualInitTest, ::testing::Bool()); 1742 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderManualInitTest, ::testing::Bool());
1746 1743
1747 INSTANTIATE_TEST_CASE_P(Service, 1744 INSTANTIATE_TEST_CASE_P(Service,
1748 GLES3DecoderRGBBackbufferTest, 1745 GLES3DecoderRGBBackbufferTest,
1749 ::testing::Bool()); 1746 ::testing::Bool());
1750 1747
1751 } // namespace gles2 1748 } // namespace gles2
1752 } // namespace gpu 1749 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder_unittest_1.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698