Index: tools/telemetry/telemetry/scrolling_interaction.py |
diff --git a/tools/telemetry/telemetry/scrolling_interaction.py b/tools/telemetry/telemetry/scrolling_interaction.py |
index a404fb3c6647af61433eed212dc5ced75657f288..19e66a5143c2b0acafa6771caec55fe36519313a 100644 |
--- a/tools/telemetry/telemetry/scrolling_interaction.py |
+++ b/tools/telemetry/telemetry/scrolling_interaction.py |
@@ -17,27 +17,29 @@ class ScrollingInteraction(page_interaction.PageInteraction): |
# Run scroll test. |
tab.runtime.Execute(scroll_js) |
- with tab.browser.platform.GetSurfaceCollector(''): |
+ if tab.browser.platform.IsRawDisplayFrameRateSupported(): |
+ tab.browser.platform.StartRawDisplayFrameRateMeasurement('') |
+ start_scroll_js = """ |
+ window.__renderingStatsDeltas = null; |
+ new __ScrollTest(function(rendering_stats_deltas) { |
+ window.__renderingStatsDeltas = rendering_stats_deltas; |
+ }).start(element); |
+ """ |
+ # scrollable_element_function is a function that passes the scrollable |
+ # element on the page to a callback. For example: |
+ # function (callback) { |
+ # callback(document.getElementById('foo')); |
+ # } |
+ if hasattr(self, 'scrollable_element_function'): |
+ tab.runtime.Execute('(%s)(function(element) { %s });' % |
+ (self.scrollable_element_function, start_scroll_js)) |
+ else: |
+ tab.runtime.Execute( |
+ '(function() { var element = document.body; %s})();' % |
+ start_scroll_js) |
- start_scroll_js = """ |
- window.__renderingStatsDeltas = null; |
- new __ScrollTest(function(rendering_stats_deltas) { |
- window.__renderingStatsDeltas = rendering_stats_deltas; |
- }).start(element); |
- """ |
- # scrollable_element_function is a function that passes the scrollable |
- # element on the page to a callback. For example: |
- # function (callback) { |
- # callback(document.getElementById('foo')); |
- # } |
- if hasattr(self, 'scrollable_element_function'): |
- tab.runtime.Execute('(%s)(function(element) { %s });' % |
- (self.scrollable_element_function, start_scroll_js)) |
- else: |
- tab.runtime.Execute( |
- '(function() { var element = document.body; %s})();' % |
- start_scroll_js) |
- |
- # Poll for scroll benchmark completion. |
- util.WaitFor(lambda: tab.runtime.Evaluate( |
- 'window.__renderingStatsDeltas'), 60) |
+ # Poll for scroll benchmark completion. |
+ util.WaitFor(lambda: tab.runtime.Evaluate( |
+ 'window.__renderingStatsDeltas'), 60) |
+ if tab.browser.platform.IsRawDisplayFrameRateSupported(): |
+ tab.browser.platform.StopRawDisplayFrameRateMeasurement() |