Commit 92cb822d authored by Amy Qiu's avatar Amy Qiu Committed by Commit Bot

Merge key_desktop_move_cases into rendering.desktop

Refactor the key_desktop_move_cases page set and merge it into the
rendering.desktop page set.

Bug: 760553
Change-Id: Ib604085a2e3fcd83dc23ef36b4b7bf58a00b8ddb
Reviewed-on: https://chromium-review.googlesource.com/1066174
Commit-Queue: Amy Qiu <amyqiu@google.com>
Reviewed-by: default avatarNed Nguyen <nednguyen@google.com>
Cr-Commit-Position: refs/heads/master@{#562059}
parent 1efb28fb
......@@ -13,7 +13,6 @@ from telemetry import story as story_module
class RenderingDesktop(perf_benchmark.PerfBenchmark):
test = rendering.Rendering
page_set = page_sets.RenderingDesktopPageSet
SUPPORTED_PLATFORMS = [story_module.expectations.ALL_DESKTOP]
@classmethod
......@@ -27,6 +26,9 @@ class RenderingDesktop(perf_benchmark.PerfBenchmark):
'This is useful for analysing scrolling behaviour '
'with tools such as perf.')
def CreateStorySet(self, options):
return page_sets.RenderingStorySet(platform='desktop')
@benchmark.Owner(emails=['sadrul@chromium.org', 'vmiura@chromium.org'])
class RenderingMobile(perf_benchmark.PerfBenchmark):
......
......@@ -124,6 +124,8 @@ crbug.com/762165 [ Win ] rendering.desktop/google_plus [ Skip ]
crbug.com/762165 [ Win ] rendering.desktop/google_image_search [ Skip ]
crbug.com/762165 [ Win ] rendering.desktop/google_docs [ Skip ]
crbug.com/841931 [ Win ] rendering.desktop/gmail [ Skip ]
crbug.com/750131 [ Win ] rendering.desktop/gmail_move [ Skip ]
crbug.com/770904 [ Mac ] rendering.desktop/gmail_move [ Skip ]
# Benchmark: rendering.mobile
crbug.com/667432 [ All ] rendering.mobile/amazon_desktop [ Skip ]
......@@ -165,8 +167,8 @@ crbug.com/822925 [ Android_Webview ] smoothness.gpu_rasterization.top_25_smooth/
crbug.com/822925 [ Android_Webview ] smoothness.gpu_rasterization.tough_pinch_zoom_cases/http://games.yahoo.com [ Skip ]
# Benchmark: smoothness.key_desktop_move_cases
crbug.com/750131 [ Win ] smoothness.key_desktop_move_cases/https://mail.google.com/mail/ [ Skip ]
crbug.com/770904 [ Mac ] smoothness.key_desktop_move_cases/https://mail.google.com/mail/ [ Skip ]
crbug.com/750131 [ Win ] smoothness.key_desktop_move_cases/gmail_move [ Skip ]
crbug.com/770904 [ Mac ] smoothness.key_desktop_move_cases/gmail_move [ Skip ]
# Benchmark: smoothness.key_mobile_sites_smooth
crbug.com/756119 [ All ] smoothness.key_mobile_sites_smooth/digg [ Skip ]
......
{
"archives": {
"Maps": {
"maps_move": {
"DEFAULT": "key_desktop_move_cases_000.wprgo"
},
"https://mail.google.com/mail/": {
"gmail_move": {
"DEFAULT": "key_desktop_move_cases_002.wprgo"
}
},
"description": "Describes the Web Page Replay archives for a story set. Don't edit by hand! Use record_wpr for updating.",
"platform_specific": true
}
\ No newline at end of file
}
......@@ -77,6 +77,12 @@
},
"google_image_search": {
"DEFAULT": "top_25_007.wprgo"
},
"maps_move": {
"DEFAULT": "key_desktop_move_cases_000.wprgo"
},
"gmail_move": {
"DEFAULT": "key_desktop_move_cases_002.wprgo"
}
},
"description": "Describes the Web Page Replay archives for a story set. Don't edit by hand! Use record_wpr for updating.",
......
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" This package contains page sets related to rendering"""
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
from telemetry import story
from page_sets.login_helpers import google_login
from page_sets.rendering import rendering_story
from page_sets.system_health import platforms
class KeyDesktopMoveCasesPage(page_module.Page):
class KeyDesktopMoveCasesPage(rendering_story.RenderingStory):
"""Abstract base class for key desktop move cases pages."""
ABSTRACT_STORY = True
SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY
def __init__(self, url, page_set, name=''):
if name == '':
name = url
def __init__(self,
page_set,
shared_page_state_class,
name_suffix='',
extra_browser_args=None):
super(KeyDesktopMoveCasesPage, self).__init__(
url=url, page_set=page_set, name=name,
shared_page_state_class=shared_page_state.SharedDesktopPageState)
page_set=page_set,
shared_page_state_class=shared_page_state_class,
name_suffix=name_suffix,
extra_browser_args=extra_browser_args)
class GmailMouseScrollPage(KeyDesktopMoveCasesPage):
""" Why: productivity, top google properties """
def __init__(self, page_set):
BASE_NAME = 'gmail_move'
URL = 'https://mail.google.com/mail/'
def __init__(self,
page_set,
shared_page_state_class=shared_page_state.SharedDesktopPageState,
name_suffix='',
extra_browser_args=None):
super(GmailMouseScrollPage, self).__init__(
url='https://mail.google.com/mail/',
page_set=page_set)
page_set=page_set,
shared_page_state_class=shared_page_state_class,
name_suffix=name_suffix,
extra_browser_args=extra_browser_args
)
self.scrollable_element_function = '''
function(callback) {
......@@ -85,14 +101,20 @@ class GmailMouseScrollPage(KeyDesktopMoveCasesPage):
class GoogleMapsPage(KeyDesktopMoveCasesPage):
""" Why: productivity, top google properties; Supports drag gestures """
def __init__(self, page_set):
BASE_NAME = 'maps_move'
URL = 'https://www.google.co.uk/maps/@51.5043968,-0.1526806'
def __init__(self,
page_set,
shared_page_state_class=shared_page_state.SharedDesktopPageState,
name_suffix='',
extra_browser_args=None):
super(GoogleMapsPage, self).__init__(
url='https://www.google.co.uk/maps/@51.5043968,-0.1526806',
page_set=page_set,
name='Maps')
shared_page_state_class=shared_page_state_class,
name_suffix=name_suffix,
extra_browser_args=extra_browser_args)
def RunNavigateSteps(self, action_runner):
super(GoogleMapsPage, self).RunNavigateSteps(action_runner)
......@@ -116,7 +138,7 @@ class KeyDesktopMoveCasesPageSet(story.StorySet):
def __init__(self):
super(KeyDesktopMoveCasesPageSet, self).__init__(
archive_data_file='data/key_desktop_move_cases.json',
archive_data_file='../data/key_desktop_move_cases.json',
cloud_storage_bucket=story.PARTNER_BUCKET)
self.AddStory(GmailMouseScrollPage(self))
......
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
from page_sets.rendering import rendering_story
from page_sets.rendering import story_tags
from page_sets.system_health import platforms
from telemetry import story
from telemetry.page import shared_page_state
from py_utils import discover
class RenderingStorySet(story.StorySet):
"""Stories related to rendering."""
def __init__(self, platform, scroll_forever=False):
super(RenderingStorySet, self).__init__(
archive_data_file=('../data/rendering_%s.json' % platform),
cloud_storage_bucket=story.PARTNER_BUCKET)
assert platform in platforms.ALL_PLATFORMS
if platform == platforms.MOBILE:
shared_page_state_class = shared_page_state.SharedMobilePageState
elif platform == platforms.DESKTOP:
shared_page_state_class = shared_page_state.SharedDesktopPageState
else:
shared_page_state_class = shared_page_state.SharedPageState
self.scroll_forever = scroll_forever
for story_class in _IterAllRenderingStoryClasses():
if (story_class.ABSTRACT_STORY or
platform not in story_class.SUPPORTED_PLATFORMS):
continue
self.AddStory(story_class(
page_set=self,
shared_page_state_class=shared_page_state_class))
if (platform == platforms.MOBILE and
story_class.TAGS and
story_tags.GPU_RASTERIZATION in story_class.TAGS):
self.AddStory(story_class(
page_set=self,
shared_page_state_class=shared_page_state_class,
name_suffix='_desktop_gpu_raster',
extra_browser_args=['--force-gpu-rasterization']))
if (platform == platforms.MOBILE and
story_class.TAGS and
story_tags.SYNC_SCROLL in story_class.TAGS):
self.AddStory(story_class(
page_set=self,
shared_page_state_class=shared_page_state_class,
name_suffix='_sync_scroll',
extra_browser_args=['--disable-threaded-scrolling']))
class DesktopRenderingStorySet(RenderingStorySet):
"""Desktop stories related to rendering.
Note: This story set is only intended to be used for recording stories via
tools/perf/record_wpr. If you would like to use it in a benchmark, please use
the generic RenderingStorySet class instead (you'll need to override the
CreateStorySet method of your benchmark).
"""
def __init__(self):
super(DesktopRenderingStorySet, self).__init__(platform='desktop')
def _IterAllRenderingStoryClasses():
start_dir = os.path.dirname(os.path.abspath(__file__))
# Sort the classes by their names so that their order is stable and
# deterministic.
for _, cls in sorted(discover.DiscoverClasses(
start_dir=start_dir,
top_level_dir=os.path.dirname(start_dir),
base_class=rendering_story.RenderingStory).iteritems()):
yield cls
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from page_sets.rendering import story_tags
from page_sets.system_health import platforms
from telemetry.page import page
class _MetaRenderingStory(type):
"""Metaclass for RenderingStory."""
@property
def ABSTRACT_STORY(cls):
"""Class field marking whether the class is abstract.
If true, the page will NOT be instantiated and added to a Rendering
page set. This field is NOT inherited by subclasses (that's why it's
defined on the metaclass).
"""
return cls.__dict__.get('ABSTRACT_STORY', False)
class RenderingStory(page.Page):
"""Abstract base class for Rendering user stories."""
__metaclass__ = _MetaRenderingStory
BASE_NAME = NotImplemented
URL = NotImplemented
ABSTRACT_STORY = True
SUPPORTED_PLATFORMS = platforms.ALL_PLATFORMS
TAGS = None
PLATFORM_SPECIFIC = False
def __init__(self,
page_set,
shared_page_state_class,
name_suffix='',
extra_browser_args=None):
tags = []
if self.TAGS:
for t in self.TAGS:
assert t in story_tags.ALL_TAGS
tags.append(t.name)
super(RenderingStory, self).__init__(
page_set=page_set,
name=self.BASE_NAME + name_suffix,
url=self.URL,
tags=tags,
platform_specific=self.PLATFORM_SPECIFIC,
shared_page_state_class=shared_page_state_class,
extra_browser_args=extra_browser_args)
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import collections
Tag = collections.namedtuple('Tag', ['name', 'description'])
# Below are tags that describe various aspect of rendering stories.
# A story can have multiple tags. All the tags should be nouns.
GPU_RASTERIZATION = Tag(
'gpu_rasterization', 'Story tests performance with GPU rasterization.')
SYNC_SCROLL = Tag(
'sync_scroll', 'Story tests rendering with synchronous scrolling.')
def _ExtractAllTags():
all_tag_names = set()
all_tags = []
# Collect all the tags defined in this module. Also assert that there is no
# duplicate tag names.
for obj in globals().values():
if isinstance(obj, Tag):
all_tags.append(obj)
assert obj.name not in all_tag_names, 'Duplicate tag name: %s' % obj.name
all_tag_names.add(obj.name)
return all_tags
ALL_TAGS = _ExtractAllTags()
This diff is collapsed.
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import shared_page_state
from telemetry import story
from page_sets import top_25_smooth
class _SharedPageState(shared_page_state.SharedDesktopPageState):
pass
class RenderingDesktopPageSet(story.StorySet):
""" Page set for measuring rendering performance on desktop. """
def __init__(self, scroll_forever=False):
super(RenderingDesktopPageSet, self).__init__(
archive_data_file='data/rendering_desktop.json',
cloud_storage_bucket=story.PARTNER_BUCKET)
self.scroll_forever = scroll_forever
top_25_smooth.AddPagesToPageSet(
page_set=self,
shared_page_state_class=_SharedPageState)
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