Commit 2d522f76 authored by Amy Qiu's avatar Amy Qiu Committed by Commit Bot

Merge tough_scheduling_cases into rendering page sets

Move tough_scheduling_cases into the rendering folder and refactor
classes to inherit from RenderingStory

Bug: 849392
Change-Id: I247f9aff4fde03cda7ea479a9dcf88c04960c749
Reviewed-on: https://chromium-review.googlesource.com/1089459Reviewed-by: default avatarNed Nguyen <nednguyen@google.com>
Commit-Queue: Amy Qiu <amyqiu@google.com>
Cr-Commit-Position: refs/heads/master@{#565290}
parent 89e4972c
# Copyright 2014 The Chromium Authors. All rights reserved. # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
from telemetry.page import page as page_module
from telemetry.page import shared_page_state from telemetry.page import shared_page_state
from telemetry import story from telemetry import story
from page_sets.rendering import rendering_story
class ToughSchedulingCasesPage(page_module.Page):
def __init__(self, name, url, page_set): class ToughSchedulingPage(rendering_story.RenderingStory):
super(ToughSchedulingCasesPage, self).__init__( ABSTRACT_STORY = True
url=url, page_set=page_set,
shared_page_state_class=shared_page_state.SharedMobilePageState, def __init__(self,
name=name) page_set,
shared_page_state_class=shared_page_state.SharedMobilePageState,
name_suffix='',
extra_browser_args=None):
super(ToughSchedulingPage, self).__init__(
page_set=page_set,
shared_page_state_class=shared_page_state_class,
name_suffix=name_suffix,
extra_browser_args=extra_browser_args)
def RunPageInteractions(self, action_runner): def RunPageInteractions(self, action_runner):
with action_runner.CreateGestureInteraction('ScrollAction'): with action_runner.CreateGestureInteraction('ScrollAction'):
action_runner.ScrollPage() action_runner.ScrollPage()
class TouchDraggingPage(ToughSchedulingCasesPage): class TouchDraggingPage(ToughSchedulingPage):
"""Why: Simple JS touch dragging.""" """Why: Simple JS touch dragging."""
def __init__(self, page_set): BASE_NAME = 'simple_touch_drag'
super(TouchDraggingPage, self).__init__( URL = 'file://../tough_scheduling_cases/simple_touch_drag.html'
name='simple_touch_drag',
url='file://tough_scheduling_cases/simple_touch_drag.html',
page_set=page_set)
def RunPageInteractions(self, action_runner): def RunPageInteractions(self, action_runner):
with action_runner.CreateGestureInteraction('ScrollAction'): with action_runner.CreateGestureInteraction('ScrollAction'):
...@@ -39,32 +43,73 @@ class TouchDraggingPage(ToughSchedulingCasesPage): ...@@ -39,32 +43,73 @@ class TouchDraggingPage(ToughSchedulingCasesPage):
distance=400) distance=400)
class SynchronizedScrollOffsetPage(ToughSchedulingCasesPage): class SimpleTextPage(ToughSchedulingPage):
""" Why: Simple scrolling baseline"""
BASE_NAME = 'simple_text_page'
URL = 'file://../tough_scheduling_cases/simple_text_page.html'
class TouchHandlerScrollingPage(ToughSchedulingPage):
""" Why: Touch handler scrolling baseline"""
BASE_NAME = 'touch_handler_scrolling'
URL = 'file://../tough_scheduling_cases/touch_handler_scrolling.html'
class RafScrollingPage(ToughSchedulingPage):
""" Why: requestAnimationFrame scrolling baseline"""
BASE_NAME = 'raf'
URL = 'file://../tough_scheduling_cases/raf.html'
class RafCanvasScrollingPage(ToughSchedulingPage):
""" Why: Test canvas blocking behavior"""
BASE_NAME = 'raf_canvas'
URL = 'file://../tough_scheduling_cases/raf_canvas.html'
class RafAnimationScrollingPage(ToughSchedulingPage):
""" Why: Test a requestAnimationFrame with concurrent CSS animation"""
BASE_NAME = 'raf_animation'
URL = 'file://../tough_scheduling_cases/raf_animation.html'
class RafTouchAnimationScrollingPage(ToughSchedulingPage):
""" Why: Stress test for the scheduler"""
BASE_NAME = 'raf_touch_animation'
URL = 'file://../tough_scheduling_cases/raf_touch_animation.html'
class SynchronizedScrollOffsetPage(ToughSchedulingPage):
"""Why: For measuring the latency of scroll-synchronized effects.""" """Why: For measuring the latency of scroll-synchronized effects."""
def __init__(self, page_set): BASE_NAME = 'sync_scroll_offset'
super(SynchronizedScrollOffsetPage, self).__init__( URL = 'file://../tough_scheduling_cases/sync_scroll_offset.html'
name='sync_scroll_offset',
url='file://tough_scheduling_cases/sync_scroll_offset.html',
page_set=page_set)
def RunPageInteractions(self, action_runner): def RunPageInteractions(self, action_runner):
with action_runner.CreateGestureInteraction('ScrollBounceAction'): with action_runner.CreateGestureInteraction('ScrollBounceAction'):
action_runner.ScrollBouncePage() action_runner.ScrollBouncePage()
class SecondBatchJsPage(ToughSchedulingCasesPage): class SecondBatchJsPage(ToughSchedulingPage):
"""Why: For testing dynamically loading a large batch of Javascript and """Why: For testing dynamically loading a large batch of Javascript and
running a part of it in response to user input. running a part of it in response to user input.
""" """
def __init__(self, page_set, variant='medium'): ABSTRACT_STORY = True
super(SecondBatchJsPage, self).__init__(
name='second_batch_js_%s' % variant,
url='file://tough_scheduling_cases/second_batch_js.html?%s' % variant,
page_set=page_set)
def RunPageInteractions(self, action_runner): def RunPageInteractions(self, action_runner):
# Do a dummy tap to warm up the synthetic tap code path. # Do a dummy tap to warm up the synthetic tap code path.
...@@ -83,6 +128,24 @@ class SecondBatchJsPage(ToughSchedulingCasesPage): ...@@ -83,6 +128,24 @@ class SecondBatchJsPage(ToughSchedulingCasesPage):
action_runner.WaitForJavaScriptCondition('window.__finished') action_runner.WaitForJavaScriptCondition('window.__finished')
class SecondBatchLightJsPage(SecondBatchJsPage):
BASE_NAME = 'second_batch_js_light'
URL = 'file://../tough_scheduling_cases/second_batch_js.html?light'
class SecondBatchJsMediumPage(SecondBatchJsPage):
BASE_NAME = 'second_batch_js_medium'
URL = 'file://../tough_scheduling_cases/second_batch_js.html?medium'
class SecondBatchJsHeavyPage(SecondBatchJsPage):
BASE_NAME = 'second_batch_js_heavy'
URL = 'file://../tough_scheduling_cases/second_batch_js.html?heavy'
# TODO(crbug.com/760553):remove this class after
# smoothness.tough_scheduling_cases benchmark is completely
# replaced by rendering benchmarks
class ToughSchedulingCasesPageSet(story.StorySet): class ToughSchedulingCasesPageSet(story.StorySet):
"""Tough scheduler latency test cases.""" """Tough scheduler latency test cases."""
...@@ -91,40 +154,19 @@ class ToughSchedulingCasesPageSet(story.StorySet): ...@@ -91,40 +154,19 @@ class ToughSchedulingCasesPageSet(story.StorySet):
super(ToughSchedulingCasesPageSet, self).__init__( super(ToughSchedulingCasesPageSet, self).__init__(
cloud_storage_bucket=story.INTERNAL_BUCKET) cloud_storage_bucket=story.INTERNAL_BUCKET)
# Why: Simple scrolling baseline page_classes = [
self.AddStory(ToughSchedulingCasesPage( SimpleTextPage,
name='simple_text_page', TouchHandlerScrollingPage,
url='file://tough_scheduling_cases/simple_text_page.html', RafScrollingPage,
page_set=self)) RafCanvasScrollingPage,
# Why: Touch handler scrolling baseline RafAnimationScrollingPage,
self.AddStory(ToughSchedulingCasesPage( RafTouchAnimationScrollingPage,
name='touch_handler_scrolling', TouchDraggingPage,
url='file://tough_scheduling_cases/touch_handler_scrolling.html', SynchronizedScrollOffsetPage,
page_set=self)) SecondBatchLightJsPage,
# Why: requestAnimationFrame scrolling baseline SecondBatchJsMediumPage,
self.AddStory(ToughSchedulingCasesPage( SecondBatchJsHeavyPage
name='raf', ]
url='file://tough_scheduling_cases/raf.html',
page_set=self)) for page_class in page_classes:
# Why: Test canvas blocking behavior self.AddStory(page_class(self))
self.AddStory(ToughSchedulingCasesPage(
name='raf_canvas',
url='file://tough_scheduling_cases/raf_canvas.html',
page_set=self))
# Why: Test a requestAnimationFrame handler with concurrent CSS animation
self.AddStory(ToughSchedulingCasesPage(
name="raf_animation",
url='file://tough_scheduling_cases/raf_animation.html',
page_set=self))
# Why: Stress test for the scheduler
self.AddStory(ToughSchedulingCasesPage(
name="raf_touch_animation",
url='file://tough_scheduling_cases/raf_touch_animation.html',
page_set=self))
self.AddStory(TouchDraggingPage(self))
# Why: For measuring the latency of scroll-synchronized effects.
self.AddStory(SynchronizedScrollOffsetPage(page_set=self))
# Why: Test loading a large amount of Javascript.
self.AddStory(SecondBatchJsPage(page_set=self, variant='light'))
self.AddStory(SecondBatchJsPage(page_set=self, variant='medium'))
self.AddStory(SecondBatchJsPage(page_set=self, variant='heavy'))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment