| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 import os | 4 import os |
| 5 | 5 |
| 6 from telemetry import page_action | 6 from telemetry import page_action |
| 7 from telemetry import util | 7 from telemetry import util |
| 8 | 8 |
| 9 class ScrollingAction(page_action.PageAction): | 9 class ScrollingAction(page_action.PageAction): |
| 10 def __init__(self, attributes=None): | 10 def __init__(self, attributes=None): |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 def CanBeBound(self): | 47 def CanBeBound(self): |
| 48 return True | 48 return True |
| 49 | 49 |
| 50 def BindMeasurementJavaScript(self, tab, start_js, stop_js): | 50 def BindMeasurementJavaScript(self, tab, start_js, stop_js): |
| 51 # Make the scrolling action start and stop measurement automatically. | 51 # Make the scrolling action start and stop measurement automatically. |
| 52 tab.ExecuteJavaScript(""" | 52 tab.ExecuteJavaScript(""" |
| 53 window.__scrollingAction.beginMeasuringHook = function() { %s }; | 53 window.__scrollingAction.beginMeasuringHook = function() { %s }; |
| 54 window.__scrollingAction.endMeasuringHook = function() { %s }; | 54 window.__scrollingAction.endMeasuringHook = function() { %s }; |
| 55 """ % (start_js, stop_js)) | 55 """ % (start_js, stop_js)) |
| OLD | NEW |