Commit a5edee67 authored by Dominic Mazzoni's avatar Dominic Mazzoni Committed by Commit Bot

Add accessibility coverage to system_health benchmark.

Adds new stories that exercise things that sometimes cause performance
problems for accessibility: live regions, large data tables, scrolling
large complex sites, and typing in a contenteditable, and expands the
system_health benchmark to track accessibility metrics.

Bug: 712417
Change-Id: I8384083146650b3fae35ea223892053a7e0c0be4
Reviewed-on: https://chromium-review.googlesource.com/663208
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: default avatarNed Nguyen <nednguyen@google.com>
Reviewed-by: default avatarJuan Antonio Navarro Pérez <perezju@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504475}
parent 33770464
...@@ -35,9 +35,11 @@ class _CommonSystemHealthBenchmark(perf_benchmark.PerfBenchmark): ...@@ -35,9 +35,11 @@ class _CommonSystemHealthBenchmark(perf_benchmark.PerfBenchmark):
""" """
def CreateCoreTimelineBasedMeasurementOptions(self): def CreateCoreTimelineBasedMeasurementOptions(self):
options = timeline_based_measurement.Options( cat_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter(
chrome_trace_category_filter.ChromeTraceCategoryFilter( filter_string='rail,toplevel')
filter_string='rail,toplevel')) cat_filter.AddIncludedCategory('accessibility')
options = timeline_based_measurement.Options(cat_filter)
options.config.enable_battor_trace = True options.config.enable_battor_trace = True
options.config.enable_chrome_trace = True options.config.enable_chrome_trace = True
options.config.enable_cpu_trace = True options.config.enable_cpu_trace = True
...@@ -45,7 +47,8 @@ class _CommonSystemHealthBenchmark(perf_benchmark.PerfBenchmark): ...@@ -45,7 +47,8 @@ class _CommonSystemHealthBenchmark(perf_benchmark.PerfBenchmark):
'clockSyncLatencyMetric', 'clockSyncLatencyMetric',
'cpuTimeMetric', 'cpuTimeMetric',
'powerMetric', 'powerMetric',
'tracingMetric' 'tracingMetric',
'accessibilityMetric',
]) ])
loading_metrics_category.AugmentOptionsForLoadingMetrics(options) loading_metrics_category.AugmentOptionsForLoadingMetrics(options)
# The EQT metric depends on the same categories as the loading metric. # The EQT metric depends on the same categories as the loading metric.
......
...@@ -60,6 +60,12 @@ ...@@ -60,6 +60,12 @@
"browse:social:twitter_infinite_scroll": { "browse:social:twitter_infinite_scroll": {
"DEFAULT": "system_health_desktop_054.wprgo" "DEFAULT": "system_health_desktop_054.wprgo"
}, },
"browse_accessibility:tech:codesearch": {
"DEFAULT": "system_health_desktop_059.wprgo"
},
"browse_accessibility:tools:gmail_compose": {
"DEFAULT": "system_health_desktop_059.wprgo"
},
"load:games:alphabetty": { "load:games:alphabetty": {
"DEFAULT": "system_health_desktop_005.wprgo" "DEFAULT": "system_health_desktop_005.wprgo"
}, },
...@@ -186,6 +192,12 @@ ...@@ -186,6 +192,12 @@
"load:tools:weather": { "load:tools:weather": {
"DEFAULT": "system_health_desktop_004.wprgo" "DEFAULT": "system_health_desktop_004.wprgo"
}, },
"load_accessibility:media:wikipedia": {
"DEFAULT": "system_health_desktop_059.wprgo"
},
"load_accessibility:shopping:amazon": {
"DEFAULT": "system_health_desktop_059.wprgo"
},
"long_running:tools:gmail-background": { "long_running:tools:gmail-background": {
"DEFAULT": "system_health_desktop_028.wprgo" "DEFAULT": "system_health_desktop_028.wprgo"
}, },
......
e9da0dbcc23e0328990f7d6aa5ec747a2e0446e4
\ No newline at end of file
# Copyright 2017 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.login_helpers import google_login
from page_sets.system_health import platforms
from page_sets.system_health import story_tags
from page_sets.system_health import system_health_story
LONG_TEXT = """Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla
suscipit enim ut nunc vestibulum, vitae porta dui eleifend. Donec
condimentum ante malesuada mi sodales maximus. Vivamus mauris libero,
placerat a lobortis quis, aliquam id lacus. Vestibulum at sodales
odio, sed mattis est. Ut at ligula tincidunt, consequat lectus sed,
sodales felis. Aliquam erat volutpat. Praesent id egestas ex. Donec
laoreet blandit euismod. Nullam nec ultricies libero, sed suscipit
ante. Cras nec libero sed sem mollis pellentesque."""
class _AccessibilityStory(system_health_story.SystemHealthStory):
"""Abstract base class for accessibility System Health user stories."""
ABSTRACT_STORY = True
SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY
def __init__(self, story_set, take_memory_measurement):
super(_AccessibilityStory, self).__init__(
story_set, take_memory_measurement,
extra_browser_args=['--force-renderer-accessibility'])
class AccessibilityScrollingCodeSearchStory(_AccessibilityStory):
"""Tests scrolling an element within a page."""
NAME = 'browse_accessibility:tech:codesearch'
URL = 'https://cs.chromium.org/chromium/src/ui/accessibility/platform/ax_platform_node_mac.mm'
TAGS = [story_tags.ACCESSIBILITY, story_tags.SCROLL]
def RunNavigateSteps(self, action_runner):
super(AccessibilityScrollingCodeSearchStory, self).RunNavigateSteps(
action_runner)
action_runner.WaitForElement(text='// namespace ui')
action_runner.ScrollElement(selector='#file_scroller', distance=1000)
class AccessibilityWikipediaStory(_AccessibilityStory):
"""Wikipedia page on Accessibility. Long, but very simple, clean layout."""
NAME = 'load_accessibility:media:wikipedia'
URL = 'https://en.wikipedia.org/wiki/Accessibility'
TAGS = [story_tags.ACCESSIBILITY]
class AccessibilityAmazonStory(_AccessibilityStory):
"""Amazon results page. Good example of a site with a data table."""
NAME = 'load_accessibility:shopping:amazon'
URL = 'https://www.amazon.com/gp/offer-listing/B01IENFJ14'
TAGS = [story_tags.ACCESSIBILITY]
class AccessibilityGmailComposeStory(_AccessibilityStory):
"""Tests typing a lot of text into a Gmail compose window."""
NAME = 'browse_accessibility:tools:gmail_compose'
URL = 'https://mail.google.com/mail/#inbox?compose=new'
TAGS = [story_tags.ACCESSIBILITY, story_tags.KEYBOARD_INPUT]
def RunNavigateSteps(self, action_runner):
google_login.LoginGoogleAccount(action_runner, 'googletest',
self.credentials_path)
# Navigating to https://mail.google.com immediately leads to an infinite
# redirection loop due to a bug in WPR (see
# https://github.com/chromium/web-page-replay/issues/70). We therefore first
# navigate to a sub-URL to set up the session and hit the resulting
# redirection loop. Afterwards, we can safely navigate to
# https://mail.google.com.
action_runner.tab.WaitForDocumentReadyStateToBeComplete()
action_runner.Navigate(
'https://mail.google.com/mail/mu/mp/872/trigger_redirection_loop')
action_runner.tab.WaitForDocumentReadyStateToBeComplete()
super(AccessibilityGmailComposeStory, self).RunNavigateSteps(
action_runner)
action_runner.WaitForJavaScriptCondition(
'document.getElementById("loading").style.display === "none"')
# Tab from the To field to the message body.
action_runner.WaitForElement(selector='#\\:gr')
action_runner.PressKey('Tab')
action_runner.PressKey('Tab')
# EnterText doesn't handle newlines for some reason.
long_text = LONG_TEXT.replace('\n', ' ')
# Enter some text
action_runner.EnterText(long_text, character_delay_ms=1)
# Move up a couple of lines and then enter it again, this causes
# a huge amount of wrapping and re-layout
action_runner.PressKey('Home')
action_runner.PressKey('ArrowUp')
action_runner.PressKey('ArrowUp')
action_runner.EnterText(long_text, character_delay_ms=1)
...@@ -11,6 +11,8 @@ Tag = collections.namedtuple('Tag', ['name', 'description']) ...@@ -11,6 +11,8 @@ Tag = collections.namedtuple('Tag', ['name', 'description'])
# Below are tags that describe various aspect of system health stories. # Below are tags that describe various aspect of system health stories.
# A story can have multiple tags. All the tags should be noun. # A story can have multiple tags. All the tags should be noun.
ACCESSIBILITY = Tag(
'accessibility', 'Story tests performance when accessibility is enabled.')
AUDIO_PLAYBACK = Tag( AUDIO_PLAYBACK = Tag(
'audio_playback', 'Story has audio playing.') 'audio_playback', 'Story has audio playing.')
CANVAS_ANIMATION = Tag( CANVAS_ANIMATION = Tag(
...@@ -34,6 +36,8 @@ JAVASCRIPT_HEAVY = Tag( ...@@ -34,6 +36,8 @@ JAVASCRIPT_HEAVY = Tag(
'of JavaScript. The story uses 20Mb+ memory for javascript and local ' 'of JavaScript. The story uses 20Mb+ memory for javascript and local '
'run with "v8" category enabled also shows the trace has js slices across ' 'run with "v8" category enabled also shows the trace has js slices across '
'the whole run.') 'the whole run.')
KEYBOARD_INPUT = Tag(
'keyboard_input', 'Story does keyboard input.')
SCROLL = Tag( SCROLL = Tag(
'scroll', 'Story has scroll gestures & scroll animation.') 'scroll', 'Story has scroll gestures & scroll animation.')
PINCH_ZOOM = Tag( PINCH_ZOOM = Tag(
......
...@@ -42,7 +42,8 @@ class SystemHealthStory(page.Page): ...@@ -42,7 +42,8 @@ class SystemHealthStory(page.Page):
TAGS = None TAGS = None
PLATFORM_SPECIFIC = False PLATFORM_SPECIFIC = False
def __init__(self, story_set, take_memory_measurement): def __init__(self, story_set, take_memory_measurement,
extra_browser_args=None):
case, group, _ = self.NAME.split(':') case, group, _ = self.NAME.split(':')
tags = [] tags = []
if self.TAGS: if self.TAGS:
...@@ -54,7 +55,8 @@ class SystemHealthStory(page.Page): ...@@ -54,7 +55,8 @@ class SystemHealthStory(page.Page):
page_set=story_set, name=self.NAME, url=self.URL, tags=tags, page_set=story_set, name=self.NAME, url=self.URL, tags=tags,
credentials_path='../data/credentials.json', credentials_path='../data/credentials.json',
grouping_keys={'case': case, 'group': group}, grouping_keys={'case': case, 'group': group},
platform_specific=self.PLATFORM_SPECIFIC) platform_specific=self.PLATFORM_SPECIFIC,
extra_browser_args=extra_browser_args)
self._take_memory_measurement = take_memory_measurement self._take_memory_measurement = take_memory_measurement
@classmethod @classmethod
......
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