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

Unified Diff: tools/telemetry/telemetry/page/actions/swipe.py

Issue 128073002: Telemetry: Add speed parameters to swipe and scroll actions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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/telemetry/telemetry/page/actions/swipe.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/page/actions/swipe.py
diff --git a/tools/telemetry/telemetry/page/actions/swipe.py b/tools/telemetry/telemetry/page/actions/swipe.py
index 924709c4920b9499edf07d59c65bb6a2187bfe79..bb6e746ade25a5234986d107ae5ddec51eeea61f 100644
--- a/tools/telemetry/telemetry/page/actions/swipe.py
+++ b/tools/telemetry/telemetry/page/actions/swipe.py
@@ -36,6 +36,7 @@ class SwipeAction(gesture_action.GestureAction):
top_start_percentage = 0.5
direction = 'left'
distance = 100
+ speed = 800
if hasattr(self, 'left_start_percentage'):
left_start_percentage = self.left_start_percentage
if hasattr(self, 'top_start_percentage'):
@@ -47,6 +48,8 @@ class SwipeAction(gesture_action.GestureAction):
'Invalid swipe direction: %s' % direction)
if hasattr(self, 'distance'):
distance = self.distance
+ if hasattr(self, 'speed'):
+ speed = self.speed
if hasattr(self, 'element_function'):
tab.ExecuteJavaScript("""
(%s)(function(element) { window.__swipeAction.start(
@@ -54,12 +57,14 @@ class SwipeAction(gesture_action.GestureAction):
left_start_percentage: %s,
top_start_percentage: %s,
direction: '%s',
- distance: %s })
+ distance: %s,
+ speed: %s })
});""" % (self.element_function,
left_start_percentage,
top_start_percentage,
direction,
- distance))
+ distance,
+ speed))
else:
tab.ExecuteJavaScript("""
window.__swipeAction.start(
@@ -67,11 +72,13 @@ class SwipeAction(gesture_action.GestureAction):
left_start_percentage: %s,
top_start_percentage: %s,
direction: '%s',
- distance: %s });"""
+ distance: %s,
+ speed: %s });"""
% (left_start_percentage,
top_start_percentage,
direction,
- distance))
+ distance,
+ speed))
tab.WaitForJavaScriptExpression('window.__swipeActionDone', 60)
« no previous file with comments | « tools/telemetry/telemetry/page/actions/swipe.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698