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. 4from telemetry.page import shared_page_state 5 6from page_sets.rendering import rendering_story 7from page_sets.rendering import story_tags 8from page_sets.system_health import platforms 9 10 11class SimplePage(rendering_story.RenderingStory): 12 ABSTRACT_STORY = True 13 SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY 14 TAGS = [story_tags.SIMPLE_MOBILE_SITES] 15 16 def __init__(self, 17 page_set, 18 shared_page_state_class=( 19 shared_page_state.SharedMobilePageState), 20 name_suffix='', 21 extra_browser_args=None): 22 super(SimplePage, self).__init__( 23 page_set=page_set, 24 shared_page_state_class=shared_page_state_class, 25 name_suffix=name_suffix, 26 extra_browser_args=extra_browser_args) 27 28 def RunNavigateSteps(self, action_runner): 29 super(SimplePage, self).RunNavigateSteps(action_runner) 30 # TODO(epenner): Remove this wait (http://crbug.com/366933) 31 action_runner.Wait(5) 32 33 def RunPageInteractions(self, action_runner): 34 # Make the scroll longer to reduce noise. 35 with action_runner.CreateGestureInteraction('ScrollAction'): 36 action_runner.ScrollPage(direction='down', speed_in_pixels_per_second=300) 37 38 39class SimpleEbay2018Page(SimplePage): 40 BASE_NAME = 'ebay_scroll' 41 YEAR = '2018' 42 URL = 'http://www.ebay.co.uk/' 43 44 45class SimpleFlickr2018Page(SimplePage): 46 BASE_NAME = 'flickr_scroll' 47 YEAR = '2018' 48 URL = 'https://www.flickr.com/photos/flickr/albums/72157639858715274' 49 50 51class SimpleNYCGov2018Page(SimplePage): 52 BASE_NAME = 'nyc_gov_scroll' 53 YEAR = '2018' 54 URL = 'http://www.nyc.gov' 55 56 57class SimpleNYTimes2018Page(SimplePage): 58 BASE_NAME = 'nytimes_scroll' 59 YEAR = '2018' 60 URL = 'http://m.nytimes.com/' 61