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

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

Issue 262793002: Revert of Optimize GLES2DecoderImpl::ApplyDirtyState. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 months 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "gpu/command_buffer/common/gles2_cmd_format.h" 7 #include "gpu/command_buffer/common/gles2_cmd_format.h"
8 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 8 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
9 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" 9 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h"
10 #include "gpu/command_buffer/service/cmd_buffer_engine.h" 10 #include "gpu/command_buffer/service/cmd_buffer_engine.h"
(...skipping 16 matching lines...) Expand all
27 namespace gpu { 27 namespace gpu {
28 namespace gles2 { 28 namespace gles2 {
29 29
30 using namespace cmds; 30 using namespace cmds;
31 31
32 class GLES2DecoderTest3 : public GLES2DecoderTestBase { 32 class GLES2DecoderTest3 : public GLES2DecoderTestBase {
33 public: 33 public:
34 GLES2DecoderTest3() { } 34 GLES2DecoderTest3() { }
35 }; 35 };
36 36
37 INSTANTIATE_TEST_CASE_P(Service, GLES2DecoderTest3, ::testing::Bool()); 37 TEST_F(GLES2DecoderTest3, TraceBeginCHROMIUM) {
38
39 TEST_P(GLES2DecoderTest3, TraceBeginCHROMIUM) {
40 const uint32 kBucketId = 123; 38 const uint32 kBucketId = 123;
41 const char kName[] = "test_command"; 39 const char kName[] = "test_command";
42 SetBucketAsCString(kBucketId, kName); 40 SetBucketAsCString(kBucketId, kName);
43 41
44 TraceBeginCHROMIUM begin_cmd; 42 TraceBeginCHROMIUM begin_cmd;
45 begin_cmd.Init(kBucketId); 43 begin_cmd.Init(kBucketId);
46 EXPECT_EQ(error::kNoError, ExecuteCmd(begin_cmd)); 44 EXPECT_EQ(error::kNoError, ExecuteCmd(begin_cmd));
47 } 45 }
48 46
49 TEST_P(GLES2DecoderTest3, TraceEndCHROMIUM) { 47 TEST_F(GLES2DecoderTest3, TraceEndCHROMIUM) {
50 // Test end fails if no begin. 48 // Test end fails if no begin.
51 TraceEndCHROMIUM end_cmd; 49 TraceEndCHROMIUM end_cmd;
52 end_cmd.Init(); 50 end_cmd.Init();
53 EXPECT_EQ(error::kNoError, ExecuteCmd(end_cmd)); 51 EXPECT_EQ(error::kNoError, ExecuteCmd(end_cmd));
54 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); 52 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
55 53
56 const uint32 kBucketId = 123; 54 const uint32 kBucketId = 123;
57 const char kName[] = "test_command"; 55 const char kName[] = "test_command";
58 SetBucketAsCString(kBucketId, kName); 56 SetBucketAsCString(kBucketId, kName);
59 57
60 TraceBeginCHROMIUM begin_cmd; 58 TraceBeginCHROMIUM begin_cmd;
61 begin_cmd.Init(kBucketId); 59 begin_cmd.Init(kBucketId);
62 EXPECT_EQ(error::kNoError, ExecuteCmd(begin_cmd)); 60 EXPECT_EQ(error::kNoError, ExecuteCmd(begin_cmd));
63 61
64 end_cmd.Init(); 62 end_cmd.Init();
65 EXPECT_EQ(error::kNoError, ExecuteCmd(end_cmd)); 63 EXPECT_EQ(error::kNoError, ExecuteCmd(end_cmd));
66 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 64 EXPECT_EQ(GL_NO_ERROR, GetGLError());
67 } 65 }
68 66
69 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h" 67 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h"
70 68
71 } // namespace gles2 69 } // namespace gles2
72 } // namespace gpu 70 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698