Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / tools / telemetry / telemetry / page / actions / pinch.py
index ff2e471..a685bbb 100644 (file)
@@ -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 PinchAction(gesture_action.GestureAction):
+class PinchAction(GestureAction):
   def __init__(self, attributes=None):
     super(PinchAction, self).__init__(attributes)
     self._SetTimelineMarkerBaseName('PinchAction::RunAction')
@@ -22,6 +22,11 @@ class PinchAction(gesture_action.GestureAction):
       raise page_action.PageActionNotSupported(
           'Synthetic pinch not supported for this browser')
 
+    if (GestureAction.GetGestureSourceTypeFromOptions(tab) ==
+        'chrome.gpuBenchmarking.MOUSE_INPUT'):
+      raise page_action.PageActionNotSupported(
+          'Pinch page action does not support mouse input')
+
     done_callback = 'function() { window.__pinchActionDone = true; }'
     tab.ExecuteJavaScript("""
         window.__pinchActionDone = false;