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

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

Issue 2471853002: remove 'unsafe' from ES3 apis in gpu process (Closed)
Patch Set: forgot to save file 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(feature_info()->IsWebGL2OrES3Context());
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 1578 matching lines...) Expand 10 before | Expand all | Expand 10 after
1681 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 1681 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
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);
1692 command_line.AppendSwitch(switches::kEnableUnsafeES3APIs);
1693 InitState init; 1691 InitState init;
1694 init.gl_version = "OpenGL ES 3.0"; 1692 init.gl_version = "OpenGL ES 3.0";
1695 init.bind_generates_resource = true; 1693 init.bind_generates_resource = true;
1696 init.context_type = CONTEXT_TYPE_OPENGLES3; 1694 init.context_type = CONTEXT_TYPE_OPENGLES3;
1697 InitDecoderWithCommandLine(init, &command_line); 1695 InitDecoder(init);
1698 } 1696 }
1699 1697
1700 void GLES3DecoderWithShaderTest::SetUp() { 1698 void GLES3DecoderWithShaderTest::SetUp() {
1701 base::CommandLine command_line(0, nullptr);
1702 command_line.AppendSwitch(switches::kEnableUnsafeES3APIs);
1703 InitState init; 1699 InitState init;
1704 init.gl_version = "OpenGL ES 3.0"; 1700 init.gl_version = "OpenGL ES 3.0";
1705 init.bind_generates_resource = true; 1701 init.bind_generates_resource = true;
1706 init.context_type = CONTEXT_TYPE_OPENGLES3; 1702 init.context_type = CONTEXT_TYPE_OPENGLES3;
1707 InitDecoderWithCommandLine(init, &command_line); 1703 InitDecoder(init);
1708 SetupDefaultProgram(); 1704 SetupDefaultProgram();
1709 } 1705 }
1710 1706
1711 void GLES3DecoderRGBBackbufferTest::SetUp() { 1707 void GLES3DecoderRGBBackbufferTest::SetUp() {
1712 base::CommandLine command_line(0, nullptr); 1708 base::CommandLine command_line(0, nullptr);
1713 command_line.AppendSwitch(switches::kEnableUnsafeES3APIs);
1714 command_line.AppendSwitchASCII( 1709 command_line.AppendSwitchASCII(
1715 switches::kGpuDriverBugWorkarounds, 1710 switches::kGpuDriverBugWorkarounds,
1716 base::IntToString(gpu::CLEAR_ALPHA_IN_READPIXELS)); 1711 base::IntToString(gpu::CLEAR_ALPHA_IN_READPIXELS));
1717 InitState init; 1712 InitState init;
1718 init.gl_version = "OpenGL ES 3.0"; 1713 init.gl_version = "OpenGL ES 3.0";
1719 init.bind_generates_resource = true; 1714 init.bind_generates_resource = true;
1720 init.context_type = CONTEXT_TYPE_OPENGLES3; 1715 init.context_type = CONTEXT_TYPE_OPENGLES3;
1721 InitDecoderWithCommandLine(init, &command_line); 1716 InitDecoderWithCommandLine(init, &command_line);
1722 SetupDefaultProgram(); 1717 SetupDefaultProgram();
1723 } 1718 }
(...skipping 19 matching lines...) Expand all
1743 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderWithShaderTest, ::testing::Bool()); 1738 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderWithShaderTest, ::testing::Bool());
1744 1739
1745 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderManualInitTest, ::testing::Bool()); 1740 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderManualInitTest, ::testing::Bool());
1746 1741
1747 INSTANTIATE_TEST_CASE_P(Service, 1742 INSTANTIATE_TEST_CASE_P(Service,
1748 GLES3DecoderRGBBackbufferTest, 1743 GLES3DecoderRGBBackbufferTest,
1749 ::testing::Bool()); 1744 ::testing::Bool());
1750 1745
1751 } // namespace gles2 1746 } // namespace gles2
1752 } // namespace gpu 1747 } // 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