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

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: Multiple actions on Maps benchmark. 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..d99af21b75711ecf9eeb7bd711b4ad8db9f1868f 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 drag gesture on the page.
petrcermak 2015/02/25 11:35:48 nit: "... a drag gesture ..."
ssid 2015/02/27 11:35:15 Done.
+
+ You should specify a start and an end point in ratios of page width and
+ height respectively (see drag.js for full implementation).
petrcermak 2015/02/25 11:35:48 I don't think "respectively" belongs here. It sugg
ssid 2015/02/27 11:35:15 Done.
+
+ Args:
+ left_start_ratio: The horizontal starting coordinate of the
+ gesture, as a ratio of the visible bounding rectangle for
petrcermak 2015/02/25 11:35:48 nit: [Take this only as an opinion] I would person
ssid 2015/02/27 11:35:15 keeping this consistent with the file.
+ 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,
petrcermak 2015/02/25 11:35:48 I would suggest putting every argument on a single
ssid 2015/02/27 11:35:15 Keeping this consistent with the style in file.
+ 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