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

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

Issue 1291513004: smoothness.scrolling_tough_ad_cases to use browser driven scrolls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final nits Created 5 years, 4 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 | « tools/telemetry/telemetry/internal/browser/web_contents.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/page/action_runner.py
diff --git a/tools/telemetry/telemetry/page/action_runner.py b/tools/telemetry/telemetry/page/action_runner.py
index 7b93f504f5f98974889141571d19153b92505dd1..4c77f72b40d5d36b3bbd514314efb48f00a95ca3 100644
--- a/tools/telemetry/telemetry/page/action_runner.py
+++ b/tools/telemetry/telemetry/page/action_runner.py
@@ -18,6 +18,7 @@ from telemetry.internal.actions.pinch import PinchAction
from telemetry.internal.actions.play import PlayAction
from telemetry.internal.actions.repaint_continuously import (
RepaintContinuouslyAction)
+from telemetry.internal.actions.repeatable_scroll import RepeatableScrollAction
from telemetry.internal.actions.scroll import ScrollAction
from telemetry.internal.actions.scroll_bounce import ScrollBounceAction
from telemetry.internal.actions.seek import SeekAction
@@ -358,6 +359,30 @@ class ActionRunner(object):
speed_in_pixels_per_second=speed_in_pixels_per_second,
use_touch=use_touch, synthetic_gesture_source=synthetic_gesture_source))
+ def RepeatableBrowserDrivenScroll(self, x_scroll_distance_ratio=0.0,
+ y_scroll_distance_ratio=0.5,
+ repeat_count=0,
+ repeat_delay_ms=250):
+ """Perform a browser driven repeatable scroll gesture.
+
+ The scroll gesture is driven from the browser, this is useful because the
+ main thread often isn't resposive but the browser process usually is, so the
+ delay between the scroll gestures should be consistent.
+
+ Args:
+ x_scroll_distance_ratio: The horizontal lenght of the scroll as a fraction
+ of the screen width.
+ y_scroll_distance_ratio: The vertical lenght of the scroll as a fraction
+ of the screen height.
+ repeat_count: The number of additional times to repeat the gesture.
+ repeat_delay_ms: The delay in milliseconds between each scroll gesture.
+ """
+ self._RunAction(RepeatableScrollAction(
+ x_scroll_distance_ratio=x_scroll_distance_ratio,
+ y_scroll_distance_ratio=y_scroll_distance_ratio,
+ repeat_count=repeat_count,
+ repeat_delay_ms=repeat_delay_ms))
+
def ScrollElement(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,
« no previous file with comments | « tools/telemetry/telemetry/internal/browser/web_contents.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698