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

Side by Side Diff: tools/perf/measurements/polymer_load.py

Issue 255063002: copy the pica benchmark to polymer_load (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add NOTRY=true Created 6 years, 7 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 | « tools/perf/benchmarks/polymer_load.py ('k') | tools/perf/page_sets/pica.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.actions.all_page_actions import NavigateAction, WaitAction
6 from telemetry.page import page
7 from telemetry.page import page_measurement
8
9
10 class PageForPolymerLoad(page.PageWithDefaultRunNavigate):
11
12 def __init__(self, url, page_set):
13 super(PageForPolymerLoad, self).__init__(
14 url=url,
15 page_set=page_set)
16 self.script_to_evaluate_on_commit = '''
17 document.addEventListener("polymer-ready", function() {
18 var unused = document.body.offsetHeight;
19 window.__polymer_ready_time = performance.now();
20 setTimeout(function() {
21 window.__polymer_ready = true;
22 }, 1000);
23 })
24 '''
25
26 def RunNavigateSteps(self, action_runner):
27 action_runner.RunAction(NavigateAction())
28 action_runner.RunAction(WaitAction(
29 {
30 'javascript': "window.__polymer_ready"
31 }))
32
33
34 class PolymerLoadMeasurement(page_measurement.PageMeasurement):
35 def MeasurePage(self, _, tab, results):
36 result = int(tab.EvaluateJavaScript('__polymer_ready_time'))
37 results.Add('Total', 'ms', result)
OLDNEW
« no previous file with comments | « tools/perf/benchmarks/polymer_load.py ('k') | tools/perf/page_sets/pica.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698