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 shared_page_state
6 from telemetry
import story
9 class SimplePage(page_module
.Page
):
11 def __init__(self
, url
, page_set
):
12 super(SimplePage
, self
).__init
__(
15 shared_page_state_class
=shared_page_state
.Shared10InchTabletPageState
,
16 credentials_path
='data/credentials.json')
17 self
.archive_data_file
= 'data/simple_mobile_sites.json'
19 def RunNavigateSteps(self
, action_runner
):
20 super(SimplePage
, self
).RunNavigateSteps(action_runner
)
21 # TODO(epenner): Remove this wait (http://crbug.com/366933)
24 class SimpleScrollPage(SimplePage
):
26 def __init__(self
, url
, page_set
):
27 super(SimpleScrollPage
, self
).__init
__(url
=url
, page_set
=page_set
)
29 def RunPageInteractions(self
, action_runner
):
30 # Make the scroll longer to reduce noise.
31 with action_runner
.CreateGestureInteraction('ScrollAction'):
32 action_runner
.ScrollPage(direction
='down', speed_in_pixels_per_second
=300)
34 class SimpleMobileSitesPageSet(story
.StorySet
):
36 """ Simple mobile sites """
39 super(SimpleMobileSitesPageSet
, self
).__init
__(
40 archive_data_file
='data/simple_mobile_sites.json',
41 cloud_storage_bucket
=story
.PUBLIC_BUCKET
)
44 # Why: Scrolls moderately complex pages (up to 60 layers)
45 'http://www.ebay.co.uk/',
46 'https://www.flickr.com/',
47 'http://www.apple.com/mac/',
49 'http://m.nytimes.com/'
52 for url
in scroll_page_list
:
53 self
.AddStory(SimpleScrollPage(url
, self
))