1 # Copyright 2014 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 telemetry
.page
import page
as page_module
5 from telemetry
.page
import page_set
as page_set_module
8 class ToughScrollingCasesPage(page_module
.Page
):
10 def __init__(self
, url
, page_set
):
11 super(ToughScrollingCasesPage
, self
).__init
__(url
=url
, page_set
=page_set
)
13 def RunSmoothness(self
, action_runner
):
14 interaction
= action_runner
.BeginGestureInteraction(
15 'ScrollAction', is_smooth
=True)
16 action_runner
.ScrollPage()
19 class ToughFastScrollingCasesPage(page_module
.Page
):
21 def __init__(self
, url
, name
, speed_in_pixels_per_second
, page_set
):
22 super(ToughFastScrollingCasesPage
, self
).__init
__(
26 labels
=['fastscrolling'])
27 self
.speed_in_pixels_per_second
= speed_in_pixels_per_second
29 def RunSmoothness(self
, action_runner
):
30 interaction
= action_runner
.BeginGestureInteraction(
31 'ScrollAction', is_smooth
=True)
32 action_runner
.ScrollPage(
34 speed_in_pixels_per_second
=self
.speed_in_pixels_per_second
)
37 class ToughScrollingCasesPageSet(page_set_module
.PageSet
):
40 Description: A collection of difficult scrolling tests
44 super(ToughScrollingCasesPageSet
, self
).__init
__()
47 'file://tough_scrolling_cases/background_fixed.html',
48 'file://tough_scrolling_cases/cust_scrollbar.html',
49 'file://tough_scrolling_cases/div_scrolls.html',
50 'file://tough_scrolling_cases/fixed_nonstacking.html',
51 'file://tough_scrolling_cases/fixed_stacking.html',
52 'file://tough_scrolling_cases/iframe_scrolls.html',
53 'file://tough_scrolling_cases/simple.html',
54 'file://tough_scrolling_cases/wheel_body_prevdefault.html',
55 'file://tough_scrolling_cases/wheel_div_prevdefault.html'
59 self
.AddPage(ToughScrollingCasesPage(url
, self
))
61 fast_scrolling_page_name_list
= [
66 fast_scrolling_speed_list
= [
67 5000, 10000, 15000, 20000, 30000, 40000, 50000, 60000, 75000, 90000
70 for name
in fast_scrolling_page_name_list
:
71 for speed
in fast_scrolling_speed_list
:
72 self
.AddPage(ToughFastScrollingCasesPage(
73 'file://tough_scrolling_cases/' + name
+ '.html',
74 name
+ '_' + str(speed
).zfill(5) + '_pixels_per_second',