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

Re-land: Add accessibility coverage to system_health benchmark.

It looks like the test was just timing out.  Shortened the text used by
AccessibilityGmailComposeStory significantly. Locally the test went from
taking 110s to 54s.

Original CL: https://chromium-review.googlesource.com/c/chromium/src/+/663208
Reverted: https://chromium-review.googlesource.com/686454

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: I4496833409b142babc907dff8033da75789c932e
Reviewed-on: https://chromium-review.googlesource.com/688058Reviewed-by: default avatarNed Nguyen <nednguyen@google.com>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504783}
parent d9aa283a
......@@ -35,9 +35,11 @@ class _CommonSystemHealthBenchmark(perf_benchmark.PerfBenchmark):
"""
def CreateCoreTimelineBasedMeasurementOptions(self):
options = timeline_based_measurement.Options(
chrome_trace_category_filter.ChromeTraceCategoryFilter(
filter_string='rail,toplevel'))
cat_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter(
filter_string='rail,toplevel')
cat_filter.AddIncludedCategory('accessibility')
options = timeline_based_measurement.Options(cat_filter)
options.config.enable_battor_trace = True
options.config.enable_chrome_trace = True
options.config.enable_cpu_trace = True
......@@ -45,7 +47,8 @@ class _CommonSystemHealthBenchmark(perf_benchmark.PerfBenchmark):
'clockSyncLatencyMetric',
'cpuTimeMetric',
'powerMetric',
'tracingMetric'
'tracingMetric',
'accessibilityMetric',
])
loading_metrics_category.AugmentOptionsForLoadingMetrics(options)
# The EQT metric depends on the same categories as the loading metric.
......
......@@ -60,6 +60,12 @@
"browse:social:twitter_infinite_scroll": {
"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": {
"DEFAULT": "system_health_desktop_005.wprgo"
},
......@@ -186,6 +192,12 @@
"load:tools:weather": {
"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": {
"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."""
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'])
# Below are tags that describe various aspect of system health stories.
# 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', 'Story has audio playing.')
CANVAS_ANIMATION = Tag(
......@@ -34,6 +36,8 @@ JAVASCRIPT_HEAVY = Tag(
'of JavaScript. The story uses 20Mb+ memory for javascript and local '
'run with "v8" category enabled also shows the trace has js slices across '
'the whole run.')
KEYBOARD_INPUT = Tag(
'keyboard_input', 'Story does keyboard input.')
SCROLL = Tag(
'scroll', 'Story has scroll gestures & scroll animation.')
PINCH_ZOOM = Tag(
......
......@@ -54,7 +54,8 @@ class SystemHealthStory(page.Page):
TAGS = None
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(':')
tags = []
if self.TAGS:
......@@ -66,7 +67,8 @@ class SystemHealthStory(page.Page):
page_set=story_set, name=self.NAME, url=self.URL, tags=tags,
credentials_path='../data/credentials.json',
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
@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