OLD | NEW |
---|---|
(Empty) | |
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 | |
5 | |
6 from telemetry.page import shared_page_state | |
7 from telemetry.page import page as page_module | |
8 from telemetry.page import page_set as page_set_module | |
9 from telemetry.core.backends.chrome_inspector import devtools_client_backend | |
10 | |
11 | |
12 class ToughScrollingWhileZoomedInCasesPage(page_module.Page): | |
13 | |
14 def __init__(self, url, page_set): | |
15 super(ToughScrollingWhileZoomedInCasesPage, self).__init__( | |
16 url=url, | |
17 page_set=page_set, | |
18 shared_page_state_class=( | |
19 diagonal_scrolling_supported_shared_state. | |
20 DiagonalScrollingSupportedSharedState)) | |
21 | |
22 def RunPageInteractions(self, action_runner): | |
23 # First, zoom into the page | |
24 action_runner.PinchPage( | |
25 scale_factor=20.0, | |
26 speed_in_pixels_per_second=10000) | |
27 # 20.0 was chosen because at the time it was close to the maximum. | |
nednguyen
2015/04/06 21:31:25
Nits: can you indent these lines to the left?
| |
28 # The more zoomed in, the more noticable the tile rasterization. | |
29 # | |
30 # 10,000 was chosen to complete this pre-step quickly. | |
31 | |
32 # Then start measurements | |
33 interaction = action_runner.BeginGestureInteraction('ScrollAction') | |
34 # And begin the diagonal scroll | |
35 action_runner.ScrollPage( | |
36 direction='downright', | |
37 speed_in_pixels_per_second=10000) | |
38 # 10,000 was chosen because it is fast enough to completely stress the | |
39 # rasterization (on a Nexus 5) without saturating results. | |
40 interaction.End() | |
41 | |
42 | |
43 class ToughScrollingWhileZoomedInCasesPageSet(page_set_module.PageSet): | |
44 """ | |
45 Description: A collection of difficult scrolling tests | |
46 """ | |
47 | |
48 def __init__(self): | |
49 super(ToughScrollingWhileZoomedInCasesPageSet, self).__init__( | |
50 user_agent_type='desktop', | |
51 archive_data_file='data/tough_pinch_zoom_cases.json', | |
52 bucket=page_set_module.PARTNER_BUCKET) | |
53 | |
54 # The following urls were chosen because they tend to have >15% | |
55 # mean_pixels_approximated at this scrolling speed. | |
56 urls_list = [ | |
57 'file://tough_scrolling_cases/background_fixed.html', | |
58 'file://tough_scrolling_cases/fixed_nonstacking.html', | |
59 'file://tough_scrolling_cases/iframe_scrolls.html', | |
60 'file://tough_scrolling_cases/wheel_div_prevdefault.html' | |
61 ] | |
62 | |
63 for url in urls_list: | |
64 self.AddUserStory(ToughScrollingWhileZoomedInCasesPage(url, self)) | |
OLD | NEW |