[Session restore] Rename group name Enabled to Restore.
[chromium-blink-merge.git] / tools / perf / page_sets / simple_mobile_sites_fling.py
blob1e56165af06ae445c0b13871938860d68c1ccbe6
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 page_sets import fling_gesture_supported_shared_state
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
11 class SimpleFlingPage(page_module.Page):
13 def __init__(self, url, page_set):
14 super(SimpleFlingPage, self).__init__(
15 url=url,
16 page_set=page_set,
17 credentials_path='data/credentials.json',
18 shared_page_state_class=(fling_gesture_supported_shared_state\
19 .FlingGestureSupportedSharedState))
20 self.archive_data_file = 'data/simple_mobile_sites.json'
22 def RunNavigateSteps(self, action_runner):
23 super(SimpleFlingPage, self).RunNavigateSteps(action_runner)
24 # TODO(epenner): Remove this wait (http://crbug.com/366933)
25 action_runner.Wait(5)
27 def RunPageInteractions(self, action_runner):
28 interaction = action_runner.BeginGestureInteraction('FlingAction')
29 # Swiping up induces a downward fling, and 500 pixels of touch scrolling
30 # runway ensures consistent fling velocities.
31 action_runner.SwipePage(direction='up',
32 distance='500',
33 speed_in_pixels_per_second=5000)
34 interaction.End()
36 class SimpleMobileSitesFlingPageSet(page_set_module.PageSet):
38 """ Simple mobile sites """
40 def __init__(self):
41 super(SimpleMobileSitesFlingPageSet, self).__init__(
42 user_agent_type='tablet_10_inch',
43 archive_data_file='data/simple_mobile_sites.json',
44 bucket=page_set_module.PUBLIC_BUCKET)
46 fling_page_list = [
47 # Why: Scrolls moderately complex pages (up to 60 layers)
48 'http://www.ebay.co.uk/',
49 'https://www.flickr.com/',
50 'http://www.apple.com/mac/',
51 'http://www.nyc.gov',
52 'http://m.nytimes.com/'
55 for url in fling_page_list:
56 self.AddUserStory(SimpleFlingPage(url, self))