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

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

Issue 245923008: Optimize GLES2DecoderImpl::ApplyDirtyState. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on refactored gles2_cmd_decoder_unittest.cc 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 TEST_F(GLES2DecoderTest3, TraceBeginCHROMIUM) { 37 INSTANTIATE_TEST_CASE_P(Service, GLES2DecoderTest3, ::testing::Bool());
38
39 TEST_P(GLES2DecoderTest3, TraceBeginCHROMIUM) {
38 const uint32 kBucketId = 123; 40 const uint32 kBucketId = 123;
39 const char kName[] = "test_command"; 41 const char kName[] = "test_command";
40 SetBucketAsCString(kBucketId, kName); 42 SetBucketAsCString(kBucketId, kName);
41 43
42 TraceBeginCHROMIUM begin_cmd; 44 TraceBeginCHROMIUM begin_cmd;
43 begin_cmd.Init(kBucketId); 45 begin_cmd.Init(kBucketId);
44 EXPECT_EQ(error::kNoError, ExecuteCmd(begin_cmd)); 46 EXPECT_EQ(error::kNoError, ExecuteCmd(begin_cmd));
45 } 47 }
46 48
47 TEST_F(GLES2DecoderTest3, TraceEndCHROMIUM) { 49 TEST_P(GLES2DecoderTest3, TraceEndCHROMIUM) {
48 // Test end fails if no begin. 50 // Test end fails if no begin.
49 TraceEndCHROMIUM end_cmd; 51 TraceEndCHROMIUM end_cmd;
50 end_cmd.Init(); 52 end_cmd.Init();
51 EXPECT_EQ(error::kNoError, ExecuteCmd(end_cmd)); 53 EXPECT_EQ(error::kNoError, ExecuteCmd(end_cmd));
52 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); 54 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
53 55
54 const uint32 kBucketId = 123; 56 const uint32 kBucketId = 123;
55 const char kName[] = "test_command"; 57 const char kName[] = "test_command";
56 SetBucketAsCString(kBucketId, kName); 58 SetBucketAsCString(kBucketId, kName);
57 59
58 TraceBeginCHROMIUM begin_cmd; 60 TraceBeginCHROMIUM begin_cmd;
59 begin_cmd.Init(kBucketId); 61 begin_cmd.Init(kBucketId);
60 EXPECT_EQ(error::kNoError, ExecuteCmd(begin_cmd)); 62 EXPECT_EQ(error::kNoError, ExecuteCmd(begin_cmd));
61 63
62 end_cmd.Init(); 64 end_cmd.Init();
63 EXPECT_EQ(error::kNoError, ExecuteCmd(end_cmd)); 65 EXPECT_EQ(error::kNoError, ExecuteCmd(end_cmd));
64 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 66 EXPECT_EQ(GL_NO_ERROR, GetGLError());
65 } 67 }
66 68
67 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h" 69 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h"
68 70
69 } // namespace gles2 71 } // namespace gles2
70 } // namespace gpu 72 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698