Index: tools/perf/perf_tools/scrolling_benchmark.py |
diff --git a/tools/perf/perf_tools/scrolling_benchmark.py b/tools/perf/perf_tools/scrolling_benchmark.py |
index 288efb129954ac50710b0f6515173b1a16cc37f9..b25ca534342617c2c1bb0877d3d623d8622c9c76 100644 |
--- a/tools/perf/perf_tools/scrolling_benchmark.py |
+++ b/tools/perf/perf_tools/scrolling_benchmark.py |
@@ -44,33 +44,36 @@ class ScrollingBenchmark(multi_page_benchmark.MultiPageBenchmark): |
# Run scroll test. |
tab.runtime.Execute(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(page, 'scrollable_element_function'): |
- tab.runtime.Execute('(%s)(function(element) { %s });' % |
- (page.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) |
- |
- rendering_stats_deltas = tab.runtime.Evaluate( |
- 'window.__renderingStatsDeltas') |
- |
- if not (rendering_stats_deltas['numFramesSentToScreen'] > 0): |
- raise DidNotScrollException() |
+ with tab.browser.platform.GetSurfaceCollector(''): |
+ |
+ 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(page, 'scrollable_element_function'): |
+ tab.runtime.Execute('(%s)(function(element) { %s });' % |
+ (page.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) |
+ |
+ rendering_stats_deltas = tab.runtime.Evaluate( |
+ 'window.__renderingStatsDeltas') |
+ |
+ if not (rendering_stats_deltas['numFramesSentToScreen'] > 0): |
+ raise DidNotScrollException() |
return rendering_stats_deltas |
def CustomizeBrowserOptions(self, options): |