1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4 from page_sets
import diagonal_scrolling_supported_shared_state
6 from telemetry
.page
import page
as page_module
7 from telemetry
import story
10 class ToughScrollingWhileZoomedInCasesPage(page_module
.Page
):
12 def __init__(self
, url
, page_set
):
13 super(ToughScrollingWhileZoomedInCasesPage
, self
).__init
__(
16 shared_page_state_class
=(
17 diagonal_scrolling_supported_shared_state
.
18 DiagonalScrollingSupportedSharedState
))
20 def RunPageInteractions(self
, action_runner
):
21 # First, zoom into the page
22 action_runner
.PinchPage(
24 speed_in_pixels_per_second
=10000)
25 # 20.0 was chosen because at the time it was close to the maximum.
26 # The more zoomed in, the more noticable the tile rasterization.
28 # 10,000 was chosen to complete this pre-step quickly.
30 # Then start measurements
31 with action_runner
.CreateGestureInteraction('ScrollAction'):
32 # And begin the diagonal scroll
33 action_runner
.ScrollPage(
34 direction
='downright',
35 # 10,000 was chosen because it is fast enough to completely stress the
36 # rasterization (on a Nexus 5) without saturating results.
37 speed_in_pixels_per_second
=10000)
40 class ToughScrollingWhileZoomedInCasesPageSet(story
.StorySet
):
42 Description: A collection of difficult scrolling tests
46 super(ToughScrollingWhileZoomedInCasesPageSet
, self
).__init
__(
47 archive_data_file
='data/tough_pinch_zoom_cases.json',
48 cloud_storage_bucket
=story
.PARTNER_BUCKET
)
50 # The following urls were chosen because they tend to have >15%
51 # mean_pixels_approximated at this scrolling speed.
53 'file://tough_scrolling_cases/background_fixed.html',
54 'file://tough_scrolling_cases/fixed_nonstacking.html',
55 'file://tough_scrolling_cases/iframe_scrolls.html',
56 'file://tough_scrolling_cases/wheel_div_prevdefault.html'
60 self
.AddStory(ToughScrollingWhileZoomedInCasesPage(url
, self
))