| 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.SetUp(page, tab) | 38 self._smoothness_controller.Start(page, tab) |
| 39 self._smoothness_controller.Start(tab) | |
| 40 # Rasterize only what's visible. | 39 # Rasterize only what's visible. |
| 41 tab.ExecuteJavaScript( | 40 tab.ExecuteJavaScript( |
| 42 'chrome.gpuBenchmarking.setRasterizeOnlyVisibleContent();') | 41 'chrome.gpuBenchmarking.setRasterizeOnlyVisibleContent();') |
| 43 | 42 |
| 44 args = {} | 43 args = {} |
| 45 args['mode'] = self.options.mode | 44 args['mode'] = self.options.mode |
| 46 if self.options.width: | 45 if self.options.width: |
| 47 args['width'] = self.options.width | 46 args['width'] = self.options.width |
| 48 if self.options.height: | 47 if self.options.height: |
| 49 args['height'] = self.options.height | 48 args['height'] = self.options.height |
| (...skipping 23 matching lines...) Expand all Loading... |
| 73 "notify_done": true | 72 "notify_done": true |
| 74 }); | 73 }); |
| 75 """) | 74 """) |
| 76 self._smoothness_controller.Stop(tab) | 75 self._smoothness_controller.Stop(tab) |
| 77 | 76 |
| 78 def MeasurePage(self, page, tab, results): | 77 def MeasurePage(self, page, tab, results): |
| 79 self._smoothness_controller.AddResults(tab, results) | 78 self._smoothness_controller.AddResults(tab, results) |
| 80 | 79 |
| 81 def CleanUpAfterPage(self, _, tab): | 80 def CleanUpAfterPage(self, _, tab): |
| 82 self._smoothness_controller.CleanUp(tab) | 81 self._smoothness_controller.CleanUp(tab) |
| OLD | NEW |