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

Unified Diff: gpu/command_buffer/service/gpu_tracer_unittest.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/gpu_tracer.cc ('k') | mojo/public/c/gles2/gles2_call_visitor_autogen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gpu_tracer_unittest.cc
diff --git a/gpu/command_buffer/service/gpu_tracer_unittest.cc b/gpu/command_buffer/service/gpu_tracer_unittest.cc
index 2a7a94c174c8145cad10167891842f39cd755046..ccf4d6da3cf15a6fb0182c65aa4901e0e68392e5 100644
--- a/gpu/command_buffer/service/gpu_tracer_unittest.cc
+++ b/gpu/command_buffer/service/gpu_tracer_unittest.cc
@@ -22,8 +22,9 @@ using ::testing::_;
class MockOutputter : public Outputter {
public:
MockOutputter() {}
- MOCK_METHOD3(Trace,
- void(const std::string& name, int64 start_time, int64 end_time));
+ MOCK_METHOD4(Trace,
+ void(const std::string& category, const std::string& name,
+ int64 start_time, int64 end_time));
protected:
~MockOutputter() {}
@@ -113,6 +114,7 @@ class BaseGpuTracerTest : public GpuServiceTest {
SetupTimerQueryMocks();
// Expected results
+ const std::string category_name("trace_category");
const std::string trace_name("trace_test");
const int64 offset_time = 3231;
const GLint64 start_timestamp = 7 * base::Time::kNanosecondsPerMicrosecond;
@@ -125,20 +127,21 @@ class BaseGpuTracerTest : public GpuServiceTest {
// Expected Outputter::Trace call
EXPECT_CALL(*outputter,
- Trace(trace_name, expect_start_time, expect_end_time));
+ Trace(category_name, trace_name,
+ expect_start_time, expect_end_time));
scoped_refptr<GPUTrace> trace =
- new GPUTrace(outputter_ref, trace_name, offset_time,
- GetTracerType());
+ new GPUTrace(outputter_ref, category_name, trace_name,
+ offset_time, GetTracerType());
gl_fake_queries_.SetCurrentGLTime(start_timestamp);
- trace->Start();
+ trace->Start(true);
// Shouldn't be available before End() call
gl_fake_queries_.SetCurrentGLTime(end_timestamp);
EXPECT_FALSE(trace->IsAvailable());
- trace->End();
+ trace->End(true);
// Shouldn't be available until the queries complete
gl_fake_queries_.SetCurrentGLTime(end_timestamp -
« no previous file with comments | « gpu/command_buffer/service/gpu_tracer.cc ('k') | mojo/public/c/gles2/gles2_call_visitor_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698