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

Unified Diff: tools/telemetry/telemetry/scrolling_interaction.py

Issue 11428107: Telemetry: extends Platform abstraction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years 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
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()

Powered by Google App Engine
This is Rietveld 408576698