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

Unified Diff: telemetry/telemetry/internal/actions/action_runner.py

Issue 3017493002: Fix coordinate calculations under pinch-zoom
Patch Set: Add comments Created 3 years, 3 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
« no previous file with comments | « no previous file | telemetry/telemetry/internal/actions/gesture_common.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/internal/actions/action_runner.py
diff --git a/telemetry/telemetry/internal/actions/action_runner.py b/telemetry/telemetry/internal/actions/action_runner.py
index 8b2faafa1d4667d66a919ec0ab30036f464269cd..b9c7c60174520a42d076893d8ac687557a7c55c8 100644
--- a/telemetry/telemetry/internal/actions/action_runner.py
+++ b/telemetry/telemetry/internal/actions/action_runner.py
@@ -362,8 +362,7 @@ class ActionRunner(object):
gesture, as a ratio of the visible bounding rectangle for
document.body.
scale_factor: The ratio of the final span to the initial span.
- The default scale factor is
- 3.0 / (window.outerWidth/window.innerWidth).
+ The default scale factor is 3.0 / (current scale factor).
speed_in_pixels_per_second: The speed of the gesture (in pixels/s).
"""
self._RunAction(PinchAction(
@@ -371,38 +370,6 @@ class ActionRunner(object):
scale_factor=scale_factor,
speed_in_pixels_per_second=speed_in_pixels_per_second))
- def PinchElement(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):
- """Perform the pinch gesture on an element.
-
- It computes the pinch gesture automatically based on the anchor
- coordinate and the scale factor. The scale factor is the ratio of
- of the final span and the initial span of the gesture.
-
- Args:
- selector: A CSS selector describing the element.
- text: The element must contains this exact text.
- element_function: A JavaScript function (as string) that is used
- to retrieve the element. For example:
- 'function() { return foo.element; }'.
- left_anchor_ratio: The horizontal pinch anchor coordinate of the
- gesture, as a ratio of the visible bounding rectangle for
- the element.
- top_anchor_ratio: The vertical pinch anchor coordinate of the
- gesture, as a ratio of the visible bounding rectangle for
- the element.
- scale_factor: The ratio of the final span to the initial span.
- The default scale factor is
- 3.0 / (window.outerWidth/window.innerWidth).
- speed_in_pixels_per_second: The speed of the gesture (in pixels/s).
- """
- self._RunAction(PinchAction(
- selector=selector, text=text, element_function=element_function,
- left_anchor_ratio=left_anchor_ratio, top_anchor_ratio=top_anchor_ratio,
- scale_factor=scale_factor,
- speed_in_pixels_per_second=speed_in_pixels_per_second))
-
def ScrollPage(self, 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,
« no previous file with comments | « no previous file | telemetry/telemetry/internal/actions/gesture_common.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698