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

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

Issue 2445323006: command buffer: remove "unsafe" from autogenerated ES3 apis; cleanly separate ES3 tests (Closed)
Patch Set: address comment 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.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include "base/command_line.h"
7 #include "gpu/command_buffer/common/gles2_cmd_format.h" 8 #include "gpu/command_buffer/common/gles2_cmd_format.h"
8 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 9 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
9 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" 10 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h"
10 #include "gpu/command_buffer/service/cmd_buffer_engine.h" 11 #include "gpu/command_buffer/service/cmd_buffer_engine.h"
11 #include "gpu/command_buffer/service/context_group.h" 12 #include "gpu/command_buffer/service/context_group.h"
12 #include "gpu/command_buffer/service/program_manager.h" 13 #include "gpu/command_buffer/service/program_manager.h"
13 #include "gpu/command_buffer/service/test_helper.h" 14 #include "gpu/command_buffer/service/test_helper.h"
14 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
15 #include "ui/gl/gl_mock.h" 16 #include "ui/gl/gl_mock.h"
16 17
17 using ::gl::MockGLInterface; 18 using ::gl::MockGLInterface;
18 using ::testing::_; 19 using ::testing::_;
19 using ::testing::DoAll; 20 using ::testing::DoAll;
20 using ::testing::InSequence; 21 using ::testing::InSequence;
21 using ::testing::MatcherCast; 22 using ::testing::MatcherCast;
22 using ::testing::Pointee; 23 using ::testing::Pointee;
23 using ::testing::Return; 24 using ::testing::Return;
24 using ::testing::SetArrayArgument; 25 using ::testing::SetArrayArgument;
25 using ::testing::SetArgumentPointee; 26 using ::testing::SetArgumentPointee;
26 using ::testing::StrEq; 27 using ::testing::StrEq;
27 28
28 namespace gpu { 29 namespace gpu {
29 namespace gles2 { 30 namespace gles2 {
30 31
31 class GLES2DecoderTest1 : public GLES2DecoderTestBase { 32 class GLES2DecoderTest1 : public GLES2DecoderTestBase {
32 public: 33 public:
33 GLES2DecoderTest1() { } 34 GLES2DecoderTest1() { }
34 }; 35 };
35 36
37 class GLES3DecoderTest1 : public GLES2DecoderTest1 {
38 public:
39 GLES3DecoderTest1() { shader_language_version_ = 300; }
40 protected:
41 void SetUp() override {
42 base::CommandLine command_line(0, nullptr);
43 command_line.AppendSwitch(switches::kEnableUnsafeES3APIs);
44 InitState init;
45 init.gl_version = "OpenGL ES 3.0";
46 init.bind_generates_resource = true;
47 init.context_type = CONTEXT_TYPE_OPENGLES3;
48 InitDecoderWithCommandLine(init, &command_line);
49 }
50 };
51
36 INSTANTIATE_TEST_CASE_P(Service, GLES2DecoderTest1, ::testing::Bool()); 52 INSTANTIATE_TEST_CASE_P(Service, GLES2DecoderTest1, ::testing::Bool());
53 INSTANTIATE_TEST_CASE_P(Service, GLES3DecoderTest1, ::testing::Bool());
37 54
38 template <> 55 template <>
39 void GLES2DecoderTestBase::SpecializedSetup<cmds::GenerateMipmap, 0>( 56 void GLES2DecoderTestBase::SpecializedSetup<cmds::GenerateMipmap, 0>(
40 bool valid) { 57 bool valid) {
41 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId); 58 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
42 DoTexImage2D( 59 DoTexImage2D(
43 GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, GL_RGBA, GL_UNSIGNED_BYTE, 60 GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, GL_RGBA, GL_UNSIGNED_BYTE,
44 kSharedMemoryId, kSharedMemoryOffset); 61 kSharedMemoryId, kSharedMemoryOffset);
45 if (valid) { 62 if (valid) {
46 EXPECT_CALL(*gl_, GetError()) 63 EXPECT_CALL(*gl_, GetError())
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 .Times(1) 203 .Times(1)
187 .RetiresOnSaturation(); 204 .RetiresOnSaturation();
188 } 205 }
189 } 206 }
190 207
191 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h" 208 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h"
192 209
193 } // namespace gles2 210 } // namespace gles2
194 } // namespace gpu 211 } // namespace gpu
195 212
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698