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

Side by Side Diff: chrome/test/perf/frame_rate/frame_rate_tests.cc

Issue 10911268: Add some TraceAnalyzer utility methods to simplify test code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « chrome/test/gpu/gpu_feature_browsertest.cc ('k') | chrome/test/perf/rendering/latency_tests.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <map> 5 #include <map>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 } 118 }
119 119
120 bool DidRunOnGpu(const std::string& json_events) { 120 bool DidRunOnGpu(const std::string& json_events) {
121 using trace_analyzer::Query; 121 using trace_analyzer::Query;
122 using trace_analyzer::TraceAnalyzer; 122 using trace_analyzer::TraceAnalyzer;
123 123
124 // Check trace for GPU accleration. 124 // Check trace for GPU accleration.
125 scoped_ptr<TraceAnalyzer> analyzer(TraceAnalyzer::Create(json_events)); 125 scoped_ptr<TraceAnalyzer> analyzer(TraceAnalyzer::Create(json_events));
126 126
127 gfx::GLImplementation gl_impl = gfx::kGLImplementationNone; 127 gfx::GLImplementation gl_impl = gfx::kGLImplementationNone;
128 const trace_analyzer::TraceEvent* gpu_event = analyzer->FindOneEvent( 128 const trace_analyzer::TraceEvent* gpu_event = analyzer->FindFirstOf(
129 Query::EventName() == Query::String("SwapBuffers") && 129 Query::EventNameIs("SwapBuffers") &&
130 Query::EventHasNumberArg("GLImpl")); 130 Query::EventHasNumberArg("GLImpl"));
131 if (gpu_event) 131 if (gpu_event)
132 gl_impl = static_cast<gfx::GLImplementation>( 132 gl_impl = static_cast<gfx::GLImplementation>(
133 gpu_event->GetKnownArgAsInt("GLImpl")); 133 gpu_event->GetKnownArgAsInt("GLImpl"));
134 return (gl_impl == gfx::kGLImplementationDesktopGL || 134 return (gl_impl == gfx::kGLImplementationDesktopGL ||
135 gl_impl == gfx::kGLImplementationEGLGLES2); 135 gl_impl == gfx::kGLImplementationEGLGLES2);
136 } 136 }
137 137
138 void RunTest(const std::string& name) { 138 void RunTest(const std::string& name) {
139 #if defined(OS_WIN) 139 #if defined(OS_WIN)
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 kIsGpuCanvasTest | kInternal | kHasRedirect | kUseGpu | kDisableVsync, 304 kIsGpuCanvasTest | kInternal | kHasRedirect | kUseGpu | kDisableVsync,
305 kIsGpuCanvasTest | kUseReferenceBuild | kInternal | kHasRedirect | kUseGpu, 305 kIsGpuCanvasTest | kUseReferenceBuild | kInternal | kHasRedirect | kUseGpu,
306 kIsGpuCanvasTest | kUseReferenceBuild | kInternal | kHasRedirect | kUseGpu | 306 kIsGpuCanvasTest | kUseReferenceBuild | kInternal | kHasRedirect | kUseGpu |
307 kDisableVsync)); 307 kDisableVsync));
308 308
309 INTERNAL_FRAME_RATE_TEST_CANVAS_GPU(fireflies) 309 INTERNAL_FRAME_RATE_TEST_CANVAS_GPU(fireflies)
310 INTERNAL_FRAME_RATE_TEST_CANVAS_GPU(FishIE) 310 INTERNAL_FRAME_RATE_TEST_CANVAS_GPU(FishIE)
311 INTERNAL_FRAME_RATE_TEST_CANVAS_GPU(speedreading) 311 INTERNAL_FRAME_RATE_TEST_CANVAS_GPU(speedreading)
312 312
313 } // namespace 313 } // namespace
OLDNEW
« no previous file with comments | « chrome/test/gpu/gpu_feature_browsertest.cc ('k') | chrome/test/perf/rendering/latency_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698