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
.page
import page_set
as page_set_module
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(page_set_module
.PageSet
):
42 Description: A collection of difficult scrolling tests
46 super(ToughScrollingWhileZoomedInCasesPageSet
, self
).__init
__(
47 user_agent_type
='desktop',
48 archive_data_file
='data/tough_pinch_zoom_cases.json',
49 bucket
=page_set_module
.PARTNER_BUCKET
)
51 # The following urls were chosen because they tend to have >15%
52 # mean_pixels_approximated at this scrolling speed.
54 'file://tough_scrolling_cases/background_fixed.html',
55 'file://tough_scrolling_cases/fixed_nonstacking.html',
56 'file://tough_scrolling_cases/iframe_scrolls.html',
57 'file://tough_scrolling_cases/wheel_div_prevdefault.html'
61 self
.AddUserStory(ToughScrollingWhileZoomedInCasesPage(url
, self
))