| 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, mode='viewport', width=None, height=None): | 11 def __init__(self, mode='viewport', width=None, height=None): |
| 12 super(Repaint, self).__init__() | 12 super(Repaint, self).__init__() |
| 13 self._smoothness_controller = None | 13 self._smoothness_controller = None |
| 14 self._micro_benchmark_id = None | 14 self._micro_benchmark_id = None |
| 15 self._mode = mode | 15 self._mode = mode |
| 16 self._width = width | 16 self._width = width |
| 17 self._height = height | 17 self._height = height |
| 18 | 18 |
| 19 def CustomizeBrowserOptions(self, options): | 19 def CustomizeBrowserOptions(self, options): |
| 20 options.AppendExtraBrowserArgs([ | 20 options.AppendExtraBrowserArgs([ |
| 21 '--enable-impl-side-painting', | 21 '--enable-impl-side-painting', |
| 22 '--enable-threaded-compositing', | 22 '--enable-threaded-compositing', |
| 23 '--enable-gpu-benchmarking' | 23 '--enable-gpu-benchmarking' |
| 24 ]) | 24 ]) |
| 25 | 25 |
| 26 def WillRunActions(self, page, tab): | 26 def WillRunActions(self, page, tab): |
| 27 tab.WaitForDocumentReadyStateToBeComplete() | 27 tab.WaitForDocumentReadyStateToBeComplete() |
| 28 self._smoothness_controller = smoothness_controller.SmoothnessController() | 28 self._smoothness_controller = smoothness_controller.SmoothnessController( |
| 29 auto_issuing_marker=False) |
| 29 self._smoothness_controller.SetUp(page, tab) | 30 self._smoothness_controller.SetUp(page, tab) |
| 30 self._smoothness_controller.Start(tab) | 31 self._smoothness_controller.Start(tab) |
| 31 # Rasterize only what's visible. | 32 # Rasterize only what's visible. |
| 32 tab.ExecuteJavaScript( | 33 tab.ExecuteJavaScript( |
| 33 'chrome.gpuBenchmarking.setRasterizeOnlyVisibleContent();') | 34 'chrome.gpuBenchmarking.setRasterizeOnlyVisibleContent();') |
| 34 | 35 |
| 35 args = {} | 36 args = {} |
| 36 args['mode'] = self._mode | 37 args['mode'] = self._mode |
| 37 if self._width: | 38 if self._width: |
| 38 args['width'] = self._width | 39 args['width'] = self._width |
| (...skipping 25 matching lines...) Expand all Loading... |
| 64 "notify_done": true | 65 "notify_done": true |
| 65 }); | 66 }); |
| 66 """) | 67 """) |
| 67 self._smoothness_controller.Stop(tab) | 68 self._smoothness_controller.Stop(tab) |
| 68 | 69 |
| 69 def ValidateAndMeasurePage(self, page, tab, results): | 70 def ValidateAndMeasurePage(self, page, tab, results): |
| 70 self._smoothness_controller.AddResults(tab, results) | 71 self._smoothness_controller.AddResults(tab, results) |
| 71 | 72 |
| 72 def CleanUpAfterPage(self, _, tab): | 73 def CleanUpAfterPage(self, _, tab): |
| 73 self._smoothness_controller.CleanUp(tab) | 74 self._smoothness_controller.CleanUp(tab) |
| OLD | NEW |