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

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

Issue 776603003: Changed the GPU Tracer so the category names can be customized. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Service side GPU trace not turned on when device is turned on Created 6 years 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 19 matching lines...) Expand all
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 INSTANTIATE_TEST_CASE_P(Service, GLES2DecoderTest3, ::testing::Bool());
38 38
39 TEST_P(GLES2DecoderTest3, TraceBeginCHROMIUM) { 39 TEST_P(GLES2DecoderTest3, TraceBeginCHROMIUM) {
40 const uint32 kBucketId = 123; 40 const uint32 kCategoryBucketId = 123;
41 const uint32 kNameBucketId = 234;
42
43 const char kCategory[] = "test_category";
41 const char kName[] = "test_command"; 44 const char kName[] = "test_command";
42 SetBucketAsCString(kBucketId, kName); 45 SetBucketAsCString(kCategoryBucketId, kCategory);
46 SetBucketAsCString(kNameBucketId, kName);
43 47
44 TraceBeginCHROMIUM begin_cmd; 48 TraceBeginCHROMIUM begin_cmd;
45 begin_cmd.Init(kBucketId); 49 begin_cmd.Init(kCategoryBucketId, kNameBucketId);
46 EXPECT_EQ(error::kNoError, ExecuteCmd(begin_cmd)); 50 EXPECT_EQ(error::kNoError, ExecuteCmd(begin_cmd));
47 } 51 }
48 52
49 TEST_P(GLES2DecoderTest3, TraceEndCHROMIUM) { 53 TEST_P(GLES2DecoderTest3, TraceEndCHROMIUM) {
50 // Test end fails if no begin. 54 // Test end fails if no begin.
51 TraceEndCHROMIUM end_cmd; 55 TraceEndCHROMIUM end_cmd;
52 end_cmd.Init(); 56 end_cmd.Init();
53 EXPECT_EQ(error::kNoError, ExecuteCmd(end_cmd)); 57 EXPECT_EQ(error::kNoError, ExecuteCmd(end_cmd));
54 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError()); 58 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
55 59
56 const uint32 kBucketId = 123; 60 const uint32 kCategoryBucketId = 123;
61 const uint32 kNameBucketId = 234;
62
63 const char kCategory[] = "test_category";
57 const char kName[] = "test_command"; 64 const char kName[] = "test_command";
58 SetBucketAsCString(kBucketId, kName); 65 SetBucketAsCString(kCategoryBucketId, kCategory);
66 SetBucketAsCString(kNameBucketId, kName);
59 67
60 TraceBeginCHROMIUM begin_cmd; 68 TraceBeginCHROMIUM begin_cmd;
61 begin_cmd.Init(kBucketId); 69 begin_cmd.Init(kCategoryBucketId, kNameBucketId);
62 EXPECT_EQ(error::kNoError, ExecuteCmd(begin_cmd)); 70 EXPECT_EQ(error::kNoError, ExecuteCmd(begin_cmd));
63 71
64 end_cmd.Init(); 72 end_cmd.Init();
65 EXPECT_EQ(error::kNoError, ExecuteCmd(end_cmd)); 73 EXPECT_EQ(error::kNoError, ExecuteCmd(end_cmd));
66 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 74 EXPECT_EQ(GL_NO_ERROR, GetGLError());
67 } 75 }
68 76
69 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h" 77 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h"
70 78
71 } // namespace gles2 79 } // namespace gles2
72 } // namespace gpu 80 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | gpu/command_buffer/service/gpu_tracer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698