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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 from telemetry.page import page_test
6
7
8 def Repaint(action_runner, mode='viewport', width=None, height=None):
9 # Rasterize only what's visible.
10 action_runner.ExecuteJavaScript(
11 'chrome.gpuBenchmarking.setRasterizeOnlyVisibleContent();')
12
13 args = {}
14 args['mode'] = mode
15 if width:
16 args['width'] = width
17 if height:
18 args['height'] = height
19
20 # Enque benchmark
21 action_runner.ExecuteJavaScript("""
22 window.benchmark_results = {};
23 window.benchmark_results.id =
24 chrome.gpuBenchmarking.runMicroBenchmark(
25 "invalidation_benchmark",
26 function(value) {},
27 """ + str(args) + """
28 );
29 """)
30
31 micro_benchmark_id = action_runner.EvaluateJavaScript(
32 'window.benchmark_results.id')
33 if (not micro_benchmark_id):
34 raise page_test.MeasurementFailure(
35 'Failed to schedule invalidation_benchmark.')
36
37 with action_runner.CreateInteraction('Repaint'):
38 action_runner.RepaintContinuously(seconds=5)
39
40 action_runner.ExecuteJavaScript("""
41 window.benchmark_results.message_handled =
42 chrome.gpuBenchmarking.sendMessageToMicroBenchmark(
43 """ + str(micro_benchmark_id) + """, {
44 "notify_done": true
45 });
46 """)
OLDNEW
« 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