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

Unified Diff: tools/perf/page_sets/repaint_helpers.py

Issue 1089223003: Move all the page actions from repaint measurements to repaint pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 | « tools/perf/page_sets/key_mobile_sites_repaint.py ('k') | tools/perf/page_sets/top_25_repaint.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/page_sets/repaint_helpers.py
diff --git a/tools/perf/page_sets/repaint_helpers.py b/tools/perf/page_sets/repaint_helpers.py
new file mode 100644
index 0000000000000000000000000000000000000000..66442fa5a4e7ba18099b74328117ab217dd2d1a3
--- /dev/null
+++ b/tools/perf/page_sets/repaint_helpers.py
@@ -0,0 +1,46 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from telemetry.page import page_test
+
+
+def Repaint(action_runner, mode='viewport', width=None, height=None):
+ # Rasterize only what's visible.
+ action_runner.ExecuteJavaScript(
+ 'chrome.gpuBenchmarking.setRasterizeOnlyVisibleContent();')
+
+ args = {}
+ args['mode'] = mode
+ if width:
+ args['width'] = width
+ if height:
+ args['height'] = height
+
+ # Enque benchmark
+ action_runner.ExecuteJavaScript("""
+ window.benchmark_results = {};
+ window.benchmark_results.id =
+ chrome.gpuBenchmarking.runMicroBenchmark(
+ "invalidation_benchmark",
+ function(value) {},
+ """ + str(args) + """
+ );
+ """)
+
+ micro_benchmark_id = action_runner.EvaluateJavaScript(
+ 'window.benchmark_results.id')
+ if (not micro_benchmark_id):
+ raise page_test.MeasurementFailure(
+ 'Failed to schedule invalidation_benchmark.')
+
+ with action_runner.CreateInteraction('Repaint'):
+ action_runner.RepaintContinuously(seconds=5)
+
+ action_runner.ExecuteJavaScript("""
+ window.benchmark_results.message_handled =
+ chrome.gpuBenchmarking.sendMessageToMicroBenchmark(
+ """ + str(micro_benchmark_id) + """, {
+ "notify_done": true
+ });
+ """)
« no previous file with comments | « tools/perf/page_sets/key_mobile_sites_repaint.py ('k') | tools/perf/page_sets/top_25_repaint.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698