[Session restore] Rename group name Enabled to Restore.
[chromium-blink-merge.git] / tools / perf / measurements / smoothness.py
blobb97a2f8ff6dd7354853cc17efd16a69311fabb45
1 # Copyright 2013 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.
5 from telemetry.page import page_test
7 from measurements import smoothness_controller
8 from metrics import power
11 class Smoothness(page_test.PageTest):
12 def __init__(self):
13 super(Smoothness, self).__init__()
14 self._power_metric = None
15 self._smoothness_controller = None
17 @classmethod
18 def CustomizeBrowserOptions(cls, options):
19 options.AppendExtraBrowserArgs('--enable-gpu-benchmarking')
20 options.AppendExtraBrowserArgs('--touch-events=enabled')
21 options.AppendExtraBrowserArgs('--running-performance-benchmark')
22 power.PowerMetric.CustomizeBrowserOptions(options)
24 def WillStartBrowser(self, platform):
25 self._power_metric = power.PowerMetric(platform)
27 def WillNavigateToPage(self, page, tab):
28 self._power_metric.Start(page, tab)
29 self._smoothness_controller = smoothness_controller.SmoothnessController()
30 self._smoothness_controller.SetUp(page, tab)
32 def WillRunActions(self, page, tab):
33 self._smoothness_controller.Start(tab)
35 def DidRunActions(self, page, tab):
36 self._power_metric.Stop(page, tab)
37 self._smoothness_controller.Stop(tab)
39 def ValidateAndMeasurePage(self, page, tab, results):
40 self._power_metric.AddResults(tab, results)
41 self._smoothness_controller.AddResults(tab, results)
43 def CleanUpAfterPage(self, page, tab):
44 if self._power_metric:
45 self._power_metric.Stop(page, tab)
46 if self._smoothness_controller:
47 self._smoothness_controller.CleanUp(tab)