from telemetry.page import shared_page_state
from page_sets.rendering import rendering_story
from page_sets.rendering import story_tags
from page_sets.system_health import platforms
class NoOpPage(rendering_story.RenderingStory):
ABSTRACT_STORY = True
TAGS = [story_tags.KEY_NOOP]
SUPPORTED_PLATFORMS = platforms.MOBILE_ONLY
def __init__(self,
page_set,
shared_page_state_class=shared_page_state.SharedMobilePageState,
name_suffix='',
extra_browser_args=None):
super(NoOpPage, self).__init__(
page_set=page_set,
shared_page_state_class=shared_page_state_class,
name_suffix=name_suffix,
extra_browser_args=['--disable-top-sites', '--report-silk-details'])
def RunNavigateSteps(self, action_runner):
super(NoOpPage, self).RunNavigateSteps(action_runner)
action_runner.Wait(2)
def RunPageInteractions(self, action_runner):
with action_runner.CreateInteraction('IdleWaiting'):
action_runner.Wait(5)
class NoOpRafPage(NoOpPage):
BASE_NAME = 'no_op_raf'
URL = 'file://../key_noop_cases/no_op_raf.html'
class NoOpSetTimeoutPage(NoOpPage):
BASE_NAME = 'no_op_settimeout'
URL = 'file://../key_noop_cases/no_op_settimeout.html'
class NoOpTouchScrollPage(NoOpPage):
ABSTRACT_STORY = True
def RunPageInteractions(self, action_runner):
with action_runner.CreateGestureInteraction('ScrollAction'):
action_runner.ScrollPage(direction='down', use_touch=True,
speed_in_pixels_per_second=300, distance=1500)
class NoOpScrollPage(NoOpTouchScrollPage):
BASE_NAME = 'no_op_scroll'
URL = 'file://../key_noop_cases/no_op_scroll.html'
class NoOpTouchHandlerPage(NoOpTouchScrollPage):
BASE_NAME = 'no_op_touch_handler'
URL = 'file://../key_noop_cases/no_op_touch_handler.html'