Beispiel #1
0
    def RepeatableBrowserDrivenScroll(self,
                                      x_scroll_distance_ratio=0.0,
                                      y_scroll_distance_ratio=0.5,
                                      repeat_count=0,
                                      repeat_delay_ms=250,
                                      timeout=page_action.DEFAULT_TIMEOUT,
                                      prevent_fling=None,
                                      speed=None):
        """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 length of the scroll as a fraction
          of the screen width.
      y_scroll_distance_ratio: The vertical length 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.
      prevent_fling: Prevents a fling gesture.
      speed: Swipe speed in pixels per second.
    """
        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,
                timeout=timeout,
                prevent_fling=prevent_fling,
                speed=speed))
Beispiel #2
0
  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))