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

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

Issue 356243002: Delete gesture_action.py and remove support for JSON attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and address review comments. Created 6 years, 5 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/actions/pinch.py
diff --git a/tools/telemetry/telemetry/page/actions/pinch.py b/tools/telemetry/telemetry/page/actions/pinch.py
index 3ab62cf2afef669fe70e95242216b15b8bf1303d..c1ad13260b48069ed9050f1e240bc1df80bffcb5 100644
--- a/tools/telemetry/telemetry/page/actions/pinch.py
+++ b/tools/telemetry/telemetry/page/actions/pinch.py
@@ -3,15 +3,13 @@
# found in the LICENSE file.
import os
-from telemetry.page.actions.gesture_action import GestureAction
from telemetry.page.actions import page_action
-class PinchAction(GestureAction):
+class PinchAction(page_action.PageAction):
def __init__(self, selector=None, text=None, element_function=None,
left_anchor_ratio=0.5, top_anchor_ratio=0.5,
scale_factor=None, speed_in_pixels_per_second=800):
super(PinchAction, self).__init__()
- self.automatically_record_interaction = False
self._selector = selector
self._text = text
self._element_function = element_function
@@ -41,12 +39,12 @@ class PinchAction(GestureAction):
'This version of the browser doesn\'t support the new JS interface '
'for pinch gestures.')
- if (GestureAction.GetGestureSourceTypeFromOptions(tab) ==
+ if (page_action.GetGestureSourceTypeFromOptions(tab) ==
'chrome.gpuBenchmarking.MOUSE_INPUT'):
raise page_action.PageActionNotSupported(
'Pinch page action does not support mouse input')
- if not GestureAction.IsGestureSourceTypeSupported(tab, 'touch'):
+ if not page_action.IsGestureSourceTypeSupported(tab, 'touch'):
raise page_action.PageActionNotSupported(
'Touch input not supported for this browser')
@@ -62,7 +60,7 @@ class PinchAction(GestureAction):
'window.outerWidth / window.innerWidth')
return 3.0 / current_scale_factor
- def RunGesture(self, tab):
+ def RunAction(self, tab):
scale_factor = (self._scale_factor if self._scale_factor else
PinchAction._GetDefaultScaleFactorForPage(tab))
code = '''
« no previous file with comments | « tools/telemetry/telemetry/page/actions/page_action.py ('k') | tools/telemetry/telemetry/page/actions/pinch_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698