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

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

Issue 134243004: Telemetry: allow user to specify source type for synthetic gestures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-upload 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/tap.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/tap.py
diff --git a/tools/telemetry/telemetry/page/actions/tap.py b/tools/telemetry/telemetry/page/actions/tap.py
index 70bdc25da827d0bb1fd89fd1b8a08f1603a10709..adc98425ac1a227b417476eaa56a4010da556145 100644
--- a/tools/telemetry/telemetry/page/actions/tap.py
+++ b/tools/telemetry/telemetry/page/actions/tap.py
@@ -3,10 +3,10 @@
# found in the LICENSE file.
import os
-from telemetry.page.actions import gesture_action
+from telemetry.page.actions.gesture_action import GestureAction
from telemetry.page.actions import page_action
-class TapAction(gesture_action.GestureAction):
+class TapAction(GestureAction):
def __init__(self, attributes=None):
super(TapAction, self).__init__(attributes)
self._SetTimelineMarkerBaseName('TapAction::RunAction')
@@ -32,6 +32,7 @@ class TapAction(gesture_action.GestureAction):
left_position_percentage = 0.5
top_position_percentage = 0.5
duration_ms = 0
+ gesture_source_type = GestureAction.GetGestureSourceTypeFromOptions(tab)
if hasattr(self, 'left_position_percentage'):
left_position_percentage = self.left_position_percentage
if hasattr(self, 'top_position_percentage'):
@@ -44,21 +45,25 @@ class TapAction(gesture_action.GestureAction):
{ element: element,
left_position_percentage: %s,
top_position_percentage: %s,
- duration_ms: %s })
+ duration_ms: %s,
+ gesture_source_type: %s })
});""" % (self.element_function,
left_position_percentage,
top_position_percentage,
- duration_ms))
+ duration_ms,
+ gesture_source_type))
else:
tab.ExecuteJavaScript("""
window.__tapAction.start(
{ element: document.body,
left_position_percentage: %s,
top_position_percentage: %s,
- duration_ms: %s });"""
+ duration_ms: %s,
+ gesture_source_type: %s });"""
% (left_position_percentage,
top_position_percentage,
- duration_ms))
+ duration_ms,
+ gesture_source_type))
tab.WaitForJavaScriptExpression('window.__tapActionDone', 60)
« no previous file with comments | « tools/telemetry/telemetry/page/actions/tap.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698