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

Unified Diff: tools/telemetry/telemetry/page/scrolling_action.py

Issue 11428107: Telemetry: extends Platform abstraction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: __init__/close() Created 7 years, 10 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
Index: tools/telemetry/telemetry/page/scrolling_action.py
diff --git a/tools/telemetry/telemetry/page/scrolling_action.py b/tools/telemetry/telemetry/page/scrolling_action.py
index c23e4d079a40f611fbf334458b3e4de936397ee8..282096eb5bcc701edfce7498dd6e450f3c327dd1 100644
--- a/tools/telemetry/telemetry/page/scrolling_action.py
+++ b/tools/telemetry/telemetry/page/scrolling_action.py
@@ -25,24 +25,27 @@ class ScrollingAction(page_action.PageAction):
""")
def RunAction(self, page, tab, previous_action):
- with tab.browser.platform.GetSurfaceCollector(''):
- # 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.ExecuteJavaScript("""
- (%s)(function(element) {
- window.__scrollingAction.start(element);
- });""" % (self.scrollable_element_function))
- else:
- tab.ExecuteJavaScript(
- 'window.__scrollingAction.start(document.body);')
-
- # Poll for scroll benchmark completion.
- util.WaitFor(lambda: tab.EvaluateJavaScript(
- 'window.__scrollingActionDone'), 60)
+ if tab.browser.platform.IsRawDisplayFrameRateSupported():
+ tab.browser.platform.StartRawDisplayFrameRateMeasurement('')
+ # 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.ExecuteJavaScript("""
+ (%s)(function(element) {
+ window.__scrollingAction.start(element);
+ });""" % (self.scrollable_element_function))
+ else:
+ tab.ExecuteJavaScript(
+ 'window.__scrollingAction.start(document.body);')
+
+ # Poll for scroll benchmark completion.
+ util.WaitFor(lambda: tab.EvaluateJavaScript(
+ 'window.__scrollingActionDone'), 60)
+ if tab.browser.platform.IsRawDisplayFrameRateSupported():
+ tab.browser.platform.StopRawDisplayFrameRateMeasurement()
def CanBeBound(self):
return True

Powered by Google App Engine
This is Rietveld 408576698