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

Unified 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, 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/benchmarks/polymer_load.py ('k') | tools/perf/page_sets/pica.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/measurements/polymer_load.py
diff --git a/tools/perf/measurements/polymer_load.py b/tools/perf/measurements/polymer_load.py
new file mode 100644
index 0000000000000000000000000000000000000000..d7edf3d3953e3d00fb7bf1b3a4b4a4eab7a85dd3
--- /dev/null
+++ b/tools/perf/measurements/polymer_load.py
@@ -0,0 +1,37 @@
+# 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.actions.all_page_actions import NavigateAction, WaitAction
+from telemetry.page import page
+from telemetry.page import page_measurement
+
+
+class PageForPolymerLoad(page.PageWithDefaultRunNavigate):
+
+ def __init__(self, url, page_set):
+ super(PageForPolymerLoad, self).__init__(
+ url=url,
+ page_set=page_set)
+ self.script_to_evaluate_on_commit = '''
+ document.addEventListener("polymer-ready", function() {
+ var unused = document.body.offsetHeight;
+ window.__polymer_ready_time = performance.now();
+ setTimeout(function() {
+ window.__polymer_ready = true;
+ }, 1000);
+ })
+ '''
+
+ def RunNavigateSteps(self, action_runner):
+ action_runner.RunAction(NavigateAction())
+ action_runner.RunAction(WaitAction(
+ {
+ 'javascript': "window.__polymer_ready"
+ }))
+
+
+class PolymerLoadMeasurement(page_measurement.PageMeasurement):
+ def MeasurePage(self, _, tab, results):
+ result = int(tab.EvaluateJavaScript('__polymer_ready_time'))
+ results.Add('Total', 'ms', result)
« 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