| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 metrics import power | 5 from metrics import power |
| 6 from metrics import smoothness | 6 from measurements import smoothness_controller |
| 7 from telemetry.page import page_measurement | 7 from telemetry.page import page_measurement |
| 8 | 8 |
| 9 | 9 |
| 10 class Smoothness(page_measurement.PageMeasurement): | 10 class Smoothness(page_measurement.PageMeasurement): |
| 11 def __init__(self): | 11 def __init__(self): |
| 12 super(Smoothness, self).__init__('smoothness') | 12 super(Smoothness, self).__init__('smoothness') |
| 13 self._smoothness_metric = None | |
| 14 self._power_metric = None | 13 self._power_metric = None |
| 14 self._smoothness_controller = None |
| 15 | 15 |
| 16 def CustomizeBrowserOptions(self, options): | 16 def CustomizeBrowserOptions(self, options): |
| 17 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking') | 17 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking') |
| 18 power.PowerMetric.CustomizeBrowserOptions(options) | 18 power.PowerMetric.CustomizeBrowserOptions(options) |
| 19 | 19 |
| 20 def WillRunActions(self, page, tab): | 20 def WillRunActions(self, page, tab): |
| 21 self._power_metric = power.PowerMetric() | 21 self._power_metric = power.PowerMetric() |
| 22 self._power_metric.Start(page, tab) | 22 self._power_metric.Start(page, tab) |
| 23 self._smoothness_metric = smoothness.SmoothnessMetric() | 23 self._smoothness_controller = smoothness_controller.SmoothnessController() |
| 24 self._smoothness_metric.Start(page, tab) | 24 self._smoothness_controller.Start(page, tab) |
| 25 | 25 |
| 26 def DidRunAction(self, page, tab, action): | 26 def DidRunAction(self, page, tab, action): |
| 27 self._smoothness_metric.AddActionToIncludeInMetric(action) | 27 self._smoothness_controller.AddActionToIncludeInMetric(action) |
| 28 | 28 |
| 29 def DidRunActions(self, page, tab): | 29 def DidRunActions(self, page, tab): |
| 30 self._power_metric.Stop(page, tab) | 30 self._power_metric.Stop(page, tab) |
| 31 self._smoothness_metric.Stop(page, tab) | 31 self._smoothness_controller.Stop(tab) |
| 32 | 32 |
| 33 def MeasurePage(self, page, tab, results): | 33 def MeasurePage(self, page, tab, results): |
| 34 self._power_metric.AddResults(tab, results) | 34 self._power_metric.AddResults(tab, results) |
| 35 self._smoothness_metric.AddResults(tab, results) | 35 self._smoothness_controller.AddResults(tab, results) |
| OLD | NEW |