OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 from telemetry.page import page | 5 from telemetry.page import page |
6 from telemetry.page import page_test | 6 from telemetry.page import page_test |
7 from telemetry.value import scalar | 7 from telemetry.value import scalar |
8 | 8 |
9 | 9 |
10 class PageForPolymerLoad(page.Page): | 10 class PageForPolymerLoad(page.Page): |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 def RunNavigateSteps(self, action_runner): | 26 def RunNavigateSteps(self, action_runner): |
27 action_runner.NavigateToPage(self) | 27 action_runner.NavigateToPage(self) |
28 action_runner.WaitForJavaScriptCondition('window.__polymer_ready') | 28 action_runner.WaitForJavaScriptCondition('window.__polymer_ready') |
29 | 29 |
30 | 30 |
31 class PolymerLoadMeasurement(page_test.PageTest): | 31 class PolymerLoadMeasurement(page_test.PageTest): |
32 def ValidateAndMeasurePage(self, _, tab, results): | 32 def ValidateAndMeasurePage(self, _, tab, results): |
33 result = int(tab.EvaluateJavaScript('__polymer_ready_time')) | 33 result = int(tab.EvaluateJavaScript('__polymer_ready_time')) |
34 results.AddValue(scalar.ScalarValue( | 34 results.AddValue(scalar.ScalarValue( |
35 results.current_page, 'Total', 'ms', result)) | 35 results.current_page, 'Total', 'ms', result, higher_is_better=False)) |
OLD | NEW |