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

Unified Diff: chrome/test/perf/rendering/latency_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/perf/frame_rate/frame_rate_tests.cc ('k') | chrome/test/perf/rendering/throughput_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/perf/rendering/latency_tests.cc
diff --git a/chrome/test/perf/rendering/latency_tests.cc b/chrome/test/perf/rendering/latency_tests.cc
index 8a04bf4832c4a073c7ec0ff6cf9e73f309821cd9..1dacbf031a7c2c210384d9dfbf54c8666eea96f7 100644
--- a/chrome/test/perf/rendering/latency_tests.cc
+++ b/chrome/test/perf/rendering/latency_tests.cc
@@ -112,8 +112,7 @@ class LatencyTest
public ::testing::WithParamInterface<int> {
public:
explicit LatencyTest(LatencyTestMode mode) :
- query_instant_(Query::EventPhase() ==
- Query::Phase(TRACE_EVENT_PHASE_INSTANT)),
+ query_instant_(Query::EventPhaseIs(TRACE_EVENT_PHASE_INSTANT)),
// These queries are initialized in RunTest.
query_begin_swaps_(Query::Bool(false)),
query_end_swaps_(Query::Bool(false)),
@@ -280,33 +279,33 @@ void LatencyTest::RunTest(const std::vector<int>& behaviors) {
// Construct queries for searching trace events via TraceAnalyzer.
if (use_gpu_) {
query_begin_swaps_ = query_instant_ &&
- Query::EventName() == Query::String("SwapBuffersLatency") &&
+ Query::EventNameIs("SwapBuffersLatency") &&
Query::EventArg("width") != Query::Int(kWebGLCanvasWidth);
query_end_swaps_ = query_instant_ &&
- Query::EventName() == Query::String("CompositorSwapBuffersComplete");
+ Query::EventNameIs("CompositorSwapBuffersComplete");
} else if (mode_ == kSoftware) {
// Software updates need to have x=0 and y=0 to contain the input color.
query_begin_swaps_ = query_instant_ &&
- Query::EventName() == Query::String("UpdateRect") &&
+ Query::EventNameIs("UpdateRect") &&
Query::EventArg("x+y") == Query::Int(0);
query_end_swaps_ = query_instant_ &&
- Query::EventName() == Query::String("UpdateRectComplete") &&
+ Query::EventNameIs("UpdateRectComplete") &&
Query::EventArg("x+y") == Query::Int(0);
}
query_inputs_ = query_instant_ &&
- Query::EventName() == Query::String("MouseEventBegin");
+ Query::EventNameIs("MouseEventBegin");
query_blits_ = query_instant_ &&
- Query::EventName() == Query::String("DoBlit") &&
+ Query::EventNameIs("DoBlit") &&
Query::EventArg("width") == Query::Int(kWebGLCanvasWidth);
query_clears_ = query_instant_ &&
- Query::EventName() == Query::String("DoClear") &&
+ Query::EventNameIs("DoClear") &&
Query::EventArg("green") == Query::Int(kClearColorGreen);
Query query_width_swaps = Query::Bool(false);
if (use_gpu_) {
query_width_swaps = query_begin_swaps_;
} else if (mode_ == kSoftware) {
query_width_swaps = query_instant_ &&
- Query::EventName() == Query::String("UpdateRectWidth") &&
+ Query::EventNameIs("UpdateRectWidth") &&
Query::EventArg("width") > Query::Int(kWebGLCanvasWidth);
}
@@ -334,7 +333,7 @@ void LatencyTest::RunTest(const std::vector<int>& behaviors) {
// Get width of tab so that we know the limit of x coordinates for the
// injected mouse inputs.
- const TraceEvent* swap_event = analyzer_->FindOneEvent(query_width_swaps);
+ const TraceEvent* swap_event = analyzer_->FindFirstOf(query_width_swaps);
ASSERT_TRUE(swap_event);
tab_width_ = swap_event->GetKnownArgAsInt("width");
// Keep printf output clean by limiting input coords to three digits:
@@ -372,12 +371,11 @@ void LatencyTest::RunTest(const std::vector<int>& behaviors) {
if (mode_ == kWebGLThread) {
// Print vsync info when in threaded mode.
Query query_vsync =
- Query::EventName() ==
- Query::String("CCThreadProxy::onVSyncParametersChanged") &&
+ Query::EventNameIs("CCThreadProxy::onVSyncParametersChanged") &&
Query::EventHasNumberArg("monotonicTimebase") &&
Query::EventHasNumberArg("intervalInSeconds");
- const TraceEvent* vsync_info = analyzer_->FindOneEvent(query_vsync);
+ const TraceEvent* vsync_info = analyzer_->FindFirstOf(query_vsync);
if (vsync_info) {
double timebase = vsync_info->GetKnownArgAsDouble("monotonicTimebase");
double interval = vsync_info->GetKnownArgAsDouble("intervalInSeconds");
« no previous file with comments | « chrome/test/perf/frame_rate/frame_rate_tests.cc ('k') | chrome/test/perf/rendering/throughput_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698