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 measurements import smoothness_controller | 5 from measurements import smoothness_controller |
6 from telemetry.page import page_measurement | 6 from telemetry.page import page_measurement |
7 | 7 |
8 | 8 |
9 class Repaint(page_measurement.PageMeasurement): | 9 class Repaint(page_measurement.PageMeasurement): |
10 def __init__(self): | 10 def __init__(self): |
(...skipping 17 matching lines...) Expand all Loading... |
28 def CustomizeBrowserOptions(self, options): | 28 def CustomizeBrowserOptions(self, options): |
29 options.AppendExtraBrowserArgs([ | 29 options.AppendExtraBrowserArgs([ |
30 '--enable-impl-side-painting', | 30 '--enable-impl-side-painting', |
31 '--enable-threaded-compositing', | 31 '--enable-threaded-compositing', |
32 '--enable-gpu-benchmarking' | 32 '--enable-gpu-benchmarking' |
33 ]) | 33 ]) |
34 | 34 |
35 def WillRunActions(self, page, tab): | 35 def WillRunActions(self, page, tab): |
36 tab.WaitForDocumentReadyStateToBeComplete() | 36 tab.WaitForDocumentReadyStateToBeComplete() |
37 self._smoothness_controller = smoothness_controller.SmoothnessController() | 37 self._smoothness_controller = smoothness_controller.SmoothnessController() |
38 self._smoothness_controller.Start(page, tab) | 38 self._smoothness_controller.SetUp(page, tab) |
| 39 self._smoothness_controller.Start(tab) |
39 # Rasterize only what's visible. | 40 # Rasterize only what's visible. |
40 tab.ExecuteJavaScript( | 41 tab.ExecuteJavaScript( |
41 'chrome.gpuBenchmarking.setRasterizeOnlyVisibleContent();') | 42 'chrome.gpuBenchmarking.setRasterizeOnlyVisibleContent();') |
42 | 43 |
43 args = {} | 44 args = {} |
44 args['mode'] = self.options.mode | 45 args['mode'] = self.options.mode |
45 if self.options.width: | 46 if self.options.width: |
46 args['width'] = self.options.width | 47 args['width'] = self.options.width |
47 if self.options.height: | 48 if self.options.height: |
48 args['height'] = self.options.height | 49 args['height'] = self.options.height |
(...skipping 23 matching lines...) Expand all Loading... |
72 "notify_done": true | 73 "notify_done": true |
73 }); | 74 }); |
74 """) | 75 """) |
75 self._smoothness_controller.Stop(tab) | 76 self._smoothness_controller.Stop(tab) |
76 | 77 |
77 def MeasurePage(self, page, tab, results): | 78 def MeasurePage(self, page, tab, results): |
78 self._smoothness_controller.AddResults(tab, results) | 79 self._smoothness_controller.AddResults(tab, results) |
79 | 80 |
80 def CleanUpAfterPage(self, _, tab): | 81 def CleanUpAfterPage(self, _, tab): |
81 self._smoothness_controller.CleanUp(tab) | 82 self._smoothness_controller.CleanUp(tab) |
OLD | NEW |