[Android WebViewShell] Add inclusion test for webview exposed stable interfaces.
[chromium-blink-merge.git] / tools / perf / page_sets / tough_scrolling_while_zoomed_in_cases.py
blob74a0a51bc3c04e1035aeb73aae12bcfa62fdd2e5
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__(
14 url=url,
15 page_set=page_set,
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(
23 scale_factor=20.0,
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):
41 """
42 Description: A collection of difficult scrolling tests
43 """
45 def __init__(self):
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.
52 urls_list = [
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'
59 for url in urls_list:
60 self.AddStory(ToughScrollingWhileZoomedInCasesPage(url, self))