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_test | 5 from telemetry.page import page_test |
6 | 6 |
7 from measurements import smoothness_controller | 7 from measurements import smoothness_controller |
8 | 8 |
9 | 9 |
10 class Repaint(page_test.PageTest): | 10 class Repaint(page_test.PageTest): |
11 def __init__(self): | 11 def __init__(self): |
12 super(Repaint, self).__init__() | 12 super(Repaint, self).__init__() |
13 self._smoothness_controller = None | 13 self._smoothness_controller = None |
14 | 14 |
15 def CustomizeBrowserOptions(self, options): | 15 def CustomizeBrowserOptions(self, options): |
16 options.AppendExtraBrowserArgs([ | 16 options.AppendExtraBrowserArgs([ |
17 '--enable-impl-side-painting', | 17 '--enable-impl-side-painting', |
18 '--enable-threaded-compositing', | 18 '--enable-threaded-compositing', |
19 '--enable-gpu-benchmarking' | 19 '--enable-gpu-benchmarking' |
20 ]) | 20 ]) |
21 | 21 |
22 def WillRunActions(self, page, tab): | 22 def WillRunActions(self, page, tab): |
23 tab.WaitForDocumentReadyStateToBeComplete() | 23 tab.WaitForDocumentReadyStateToBeComplete() |
24 self._smoothness_controller = smoothness_controller.SmoothnessController( | 24 self._smoothness_controller = smoothness_controller.SmoothnessController() |
25 auto_issuing_marker=False) | 25 self._smoothness_controller.Start(page, tab) |
26 self._smoothness_controller.SetUp(page, tab) | |
27 self._smoothness_controller.Start(tab) | |
28 | 26 |
29 def DidRunActions(self, page, tab): | 27 def DidRunActions(self, page, tab): |
30 self._smoothness_controller.Stop(tab) | 28 self._smoothness_controller.Stop(tab) |
31 | 29 |
32 def ValidateAndMeasurePage(self, page, tab, results): | 30 def ValidateAndMeasurePage(self, page, tab, results): |
33 self._smoothness_controller.AddResults(tab, results) | 31 self._smoothness_controller.AddResults(tab, results) |
34 | 32 |
35 def CleanUpAfterPage(self, _, tab): | 33 def CleanUpAfterPage(self, _, tab): |
36 self._smoothness_controller.CleanUp(tab) | 34 self._smoothness_controller.CleanUp(tab) |
OLD | NEW |