Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Unified Diff: tools/perf/perf_tools/scrolling_benchmark.py

Issue 11187036: Android: start upstreaming some of our perf tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revert adb_commands Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/chrome_remote_control/chrome_remote_control/platform.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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):
« no previous file with comments | « tools/chrome_remote_control/chrome_remote_control/platform.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698