Commit 96004e55 authored by Sadrul Habib Chowdhury's avatar Sadrul Habib Chowdhury Committed by Commit Bot

[rendering benchmark] Prolong some scrolling tests.

Some of the stories (e.g. canvas_*_pixels_per_second,
text_*_pixels_per_second, etc.) scroll the page, but depending on the
velocity (e.g. when velocity is over 20000 pixels/second), it can end
too quickly, and produce only a handful of frames. As a result, some of
the metrics (e.g. PercentDroppedFrames.AllSequences) are not reported,
since they require at least a minimum number of frames. This can result
in some flakes (e.g. crbug.com/1113556) in the dashboard.

To fix this, keep scrolling the page for at least 15 seconds, so that
there are enough frames produced to report the metrics.

Bug: 1141854
Fixes: 1141854

Change-Id: Ia6adb0257081bf2d321c62e2c362ece3fe4c9f49
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2495340
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: default avatarMingjing Zhang <mjzhang@chromium.org>
Auto-Submit: Sadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#820845}
parent 5a9a50a6
# Copyright 2014 The Chromium Authors. All rights reserved. # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import time
from telemetry.internal.actions import page_action from telemetry.internal.actions import page_action
from telemetry.page import shared_page_state from telemetry.page import shared_page_state
...@@ -26,11 +28,18 @@ class ToughFastScrollingPage(rendering_story.RenderingStory): ...@@ -26,11 +28,18 @@ class ToughFastScrollingPage(rendering_story.RenderingStory):
extra_browser_args=extra_browser_args) extra_browser_args=extra_browser_args)
def RunPageInteractions(self, action_runner): def RunPageInteractions(self, action_runner):
start = time.time()
with action_runner.CreateGestureInteraction('ScrollAction'): with action_runner.CreateGestureInteraction('ScrollAction'):
action_runner.ScrollPage( direction = 'down'
direction='down', # Some of the metrics the benchmark reports require the scroll to run for
speed_in_pixels_per_second=self.SPEED_IN_PIXELS_PER_SECOND, # a few seconds (5+). Therefore, scroll the page for long enough that
synthetic_gesture_source=self.SYNTHETIC_GESTURE_SOURCE) # these metrics are accurately reported.
while time.time() - start < 15:
action_runner.ScrollPage(
direction=direction,
speed_in_pixels_per_second=self.SPEED_IN_PIXELS_PER_SECOND,
synthetic_gesture_source=self.SYNTHETIC_GESTURE_SOURCE)
direction = 'up' if direction == 'down' else 'down'
class ScrollingText5000Page(ToughFastScrollingPage): class ScrollingText5000Page(ToughFastScrollingPage):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment