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

Unified Diff: tools/telemetry/telemetry/page/actions/scroll.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/scroll.py
diff --git a/tools/telemetry/telemetry/page/actions/scroll.py b/tools/telemetry/telemetry/page/actions/scroll.py
index 296c230ec23643ea002dc9096e1439483d2fb54b..48990411bd4e69bd9e80f240cf5644ad7a93f804 100644
--- a/tools/telemetry/telemetry/page/actions/scroll.py
+++ b/tools/telemetry/telemetry/page/actions/scroll.py
@@ -3,14 +3,12 @@
# found in the LICENSE file.
import os
-from telemetry.page.actions.gesture_action import GestureAction
from telemetry.page.actions import page_action
-class ScrollAction(GestureAction):
+class ScrollAction(page_action.PageAction):
# TODO(chrishenry): Ignore attributes, to be deleted when usage in
# other repo is cleaned up.
- def __init__(self, attributes=None,
- selector=None, text=None, element_function=None,
+ def __init__(self, selector=None, text=None, element_function=None,
left_start_ratio=0.5, top_start_ratio=0.5, direction='down',
distance=None, distance_expr=None,
speed_in_pixels_per_second=800, use_touch=False):
@@ -18,7 +16,6 @@ class ScrollAction(GestureAction):
if direction not in ['down', 'up', 'left', 'right']:
raise page_action.PageActionNotSupported(
'Invalid scroll direction: %s' % self.direction)
- self.automatically_record_interaction = False
self._selector = selector
self._text = text
self._element_function = element_function
@@ -49,11 +46,11 @@ class ScrollAction(GestureAction):
# Fail if this action requires touch and we can't send touch events.
if self._use_touch:
- if not GestureAction.IsGestureSourceTypeSupported(tab, 'touch'):
+ if not page_action.IsGestureSourceTypeSupported(tab, 'touch'):
raise page_action.PageActionNotSupported(
'Touch scroll not supported for this browser')
- if (GestureAction.GetGestureSourceTypeFromOptions(tab) ==
+ if (page_action.GetGestureSourceTypeFromOptions(tab) ==
'chrome.gpuBenchmarking.MOUSE_INPUT'):
raise page_action.PageActionNotSupported(
'Scroll requires touch on this page but mouse input was requested')
@@ -64,12 +61,12 @@ class ScrollAction(GestureAction):
window.__scrollAction = new __ScrollAction(%s, %s);"""
% (done_callback, self._distance_func))
- def RunGesture(self, tab):
+ def RunAction(self, tab):
if (self._selector is None and self._text is None and
self._element_function is None):
self._element_function = 'document.body'
- gesture_source_type = GestureAction.GetGestureSourceTypeFromOptions(tab)
+ gesture_source_type = page_action.GetGestureSourceTypeFromOptions(tab)
if self._use_touch:
gesture_source_type = 'chrome.gpuBenchmarking.TOUCH_INPUT'
« no previous file with comments | « tools/telemetry/telemetry/page/actions/pinch_unittest.py ('k') | tools/telemetry/telemetry/page/actions/scroll_bounce.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698