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

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

Issue 955653003: Adding Maps page to page_sets for telemetry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mousedrag2
Patch Set: Disabled for android. Created 5 years, 10 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/action_runner.py
diff --git a/tools/telemetry/telemetry/page/actions/action_runner.py b/tools/telemetry/telemetry/page/actions/action_runner.py
index f615f98b862f990f36ea8dd5780bab072b9d7ea9..8b1f28575c3ea057dba76da733e5d81831cfff2a 100644
--- a/tools/telemetry/telemetry/page/actions/action_runner.py
+++ b/tools/telemetry/telemetry/page/actions/action_runner.py
@@ -6,6 +6,7 @@ import time
import logging
import urlparse
+from telemetry.page.actions.drag import DragAction
from telemetry.page.actions.javascript_click import ClickElementAction
from telemetry.page.actions.loop import LoopAction
from telemetry.page.actions.mouse_click import MouseClickAction
@@ -239,6 +240,35 @@ class ActionRunner(object):
self._RunAction(ClickElementAction(
selector=selector, text=text, element_function=element_function))
+ def DragPage(self, left_start_ratio, top_start_ratio, left_end_ratio,
+ top_end_ratio, speed_in_pixels_per_second=800, use_touch=False):
+ """Perform a drag gesture on the page.
+
+ You should specify a start and an end point in ratios of page width and
+ height (see drag.js for full implementation).
+
+ Args:
+ left_start_ratio: The horizontal starting coordinate of the
+ gesture, as a ratio of the visible bounding rectangle for
+ document.body.
+ top_start_ratio: The vertical starting coordinate of the
+ gesture, as a ratio of the visible bounding rectangle for
+ document.body.
+ left_end_ratio: The horizontal ending coordinate of the
+ gesture, as a ratio of the visible bounding rectangle for
+ document.body.
+ top_end_ratio: The vertical ending coordinate of the
+ gesture, as a ratio of the visible bounding rectangle for
+ document.body.
+ speed_in_pixels_per_second: The speed of the gesture (in pixels/s).
+ use_touch: Whether dragging should be done with touch input.
+ """
+ self._RunAction(DragAction(
+ left_start_ratio=left_start_ratio, top_start_ratio=top_start_ratio,
+ left_end_ratio=left_end_ratio, top_end_ratio=top_end_ratio,
+ speed_in_pixels_per_second=speed_in_pixels_per_second,
+ use_touch=use_touch))
+
def PinchPage(self, left_anchor_ratio=0.5, top_anchor_ratio=0.5,
scale_factor=None, speed_in_pixels_per_second=800):
"""Perform the pinch gesture on the page.

Powered by Google App Engine
This is Rietveld 408576698