Commit 271c35f7 authored by Benjamin Smith's avatar Benjamin Smith Committed by Commit Bot

[perf] Add Gmail label click story

R=tmrts@chromium.org, ulan@chromium.org

Label click is a critical user journey for Gmail.

Perform a label click and go to next page of results.

Bug: 1044682
Change-Id: I43b95f720d494451b94c225fc7cc11c7c4b3c0ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2036550
Commit-Queue: Benjamin Smith <codesmith@google.com>
Reviewed-by: default avatarJohn Chen <johnchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#782831}
parent 66cfa4c6
...@@ -314,6 +314,7 @@ crbug.com/1023366 [ desktop ] system_health.common_desktop/browse:media:youtube: ...@@ -314,6 +314,7 @@ crbug.com/1023366 [ desktop ] system_health.common_desktop/browse:media:youtube:
crbug.com/1042632 [ win ] system_health.common_desktop/load:tools:gmail:2019 [ Skip ] crbug.com/1042632 [ win ] system_health.common_desktop/load:tools:gmail:2019 [ Skip ]
crbug.com/1050068 [ win7 ] system_health.common_desktop/load:media:9gag [ Skip ] crbug.com/1050068 [ win7 ] system_health.common_desktop/load:media:9gag [ Skip ]
crbug.com/1064281 [ linux ] system_health.common_desktop/long_running:tools:gmail-foreground [ Skip ] crbug.com/1064281 [ linux ] system_health.common_desktop/long_running:tools:gmail-foreground [ Skip ]
crbug.com/1044682 [ desktop ] system_health.common_desktop/browse:tools:gmail-labelclick:2020 [ Skip ]
# Benchmark: system_health.common_mobile # Benchmark: system_health.common_mobile
...@@ -363,6 +364,7 @@ crbug.com/956191 [ win7 ] system_health.memory_desktop/browse:news:nytimes:2020 ...@@ -363,6 +364,7 @@ crbug.com/956191 [ win7 ] system_health.memory_desktop/browse:news:nytimes:2020
crbug.com/1097065 [ linux ] system_health.memory_desktop/browse:media:googleplaystore:2018 [ Skip ] crbug.com/1097065 [ linux ] system_health.memory_desktop/browse:media:googleplaystore:2018 [ Skip ]
crbug.com/1097065 [ linux ] system_health.memory_desktop/load:social:vk:2018 [ Skip ] crbug.com/1097065 [ linux ] system_health.memory_desktop/load:social:vk:2018 [ Skip ]
crbug.com/1097065 [ linux ] system_health.memory_desktop/browse_accessibility:tech:codesearch:2018 [ Skip ] crbug.com/1097065 [ linux ] system_health.memory_desktop/browse_accessibility:tech:codesearch:2018 [ Skip ]
crbug.com/1044682 [ desktop ] system_health.memory_desktop/browse:tools:gmail-labelclick:2020 [ Skip ]
# Memory dumps don't work at the moment for Google Earth, see the issue. # Memory dumps don't work at the moment for Google Earth, see the issue.
crbug.com/1057035 system_health.memory_desktop/browse:tools:earth:2020 [ Skip ] crbug.com/1057035 system_health.memory_desktop/browse:tools:earth:2020 [ Skip ]
......
...@@ -123,6 +123,9 @@ ...@@ -123,6 +123,9 @@
}, },
"browse:tools:earth:2020": { "browse:tools:earth:2020": {
"DEFAULT": "system_health_desktop_df060e3191.wprgo" "DEFAULT": "system_health_desktop_df060e3191.wprgo"
},
"browse:tools:gmail-labelclick:2020": {
"DEFAULT": "system_health_desktop_60458a481a.wprgo"
}, },
"browse:tools:maps": { "browse:tools:maps": {
"DEFAULT": "system_health_desktop_052.wprgo" "DEFAULT": "system_health_desktop_052.wprgo"
......
60458a481a4f818a3eba9c462b324cef542cac70
\ No newline at end of file
...@@ -14,6 +14,7 @@ from page_sets.system_health import story_tags ...@@ -14,6 +14,7 @@ from page_sets.system_health import story_tags
from page_sets.system_health import system_health_story from page_sets.system_health import system_health_story
from page_sets.login_helpers import facebook_login from page_sets.login_helpers import facebook_login
from page_sets.login_helpers import google_login
from page_sets.login_helpers import pinterest_login from page_sets.login_helpers import pinterest_login
from page_sets.login_helpers import tumblr_login from page_sets.login_helpers import tumblr_login
...@@ -1166,6 +1167,111 @@ class GoogleMapsStory2019(_BrowsingStory): ...@@ -1166,6 +1167,111 @@ class GoogleMapsStory2019(_BrowsingStory):
action_runner.Wait(3) action_runner.Wait(3)
##############################################################################
# Gmail browsing stories.
##############################################################################
class GmailLabelClickStory2020(system_health_story.SystemHealthStory):
NAME = 'browse:tools:gmail-labelclick:2020'
# Needs to be http and not https.
URL = 'http://mail.google.com/'
SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY
TAGS = [story_tags.YEAR_2020]
SKIP_LOGIN = False
_UPDATES_SELECTOR = 'div[data-tooltip="Updates"]'
# Page event queries.
LABEL_CLICK_BEGIN_EVENT = '''
(window.__telemetry_observed_page_events.has(
"telemetry:reported_by_page:benchmark_begin"))
'''
LABEL_CLICK_END_EVENT = '''
(window.__telemetry_observed_page_events.has(
"telemetry:reported_by_page:benchmark_end"))
'''
# These maps translates page-specific event names to event names needed for
# the reported_by_page:* metric.
EVENTS_AND_MEASURES_REPORTED_BY_PAGE = '''
window.__telemetry_reported_page_events = {
'mail:lc-1':
'telemetry:reported_by_page:benchmark_begin',
};
window.__telemetry_reported_page_measures = {
'mail:lc':
'telemetry:reported_by_page:benchmark_end'
};
'''
# Patch performance.mark and measure to get notified about page events.
PERFOMANCE_MARK_AND_MEASURE = '''
window.__telemetry_observed_page_events = new Set();
(function () {
let reported_events = window.__telemetry_reported_page_events;
let reported_measures = window.__telemetry_reported_page_measures;
let observed = window.__telemetry_observed_page_events;
let performance_mark = window.performance.mark;
let performance_measure = window.performance.measure;
window.performance.measure = function(label, mark) {
performance_measure.call(window.performance, label, mark);
if(reported_measures.hasOwnProperty(label)) {
performance_mark.call(window.performance, reported_measures[label]);
observed.add(reported_measures[label]);
}
}
window.performance.mark = function (label) {
performance_mark.call(window.performance, label);
if (reported_events.hasOwnProperty(label)) {
performance_mark.call(
window.performance, reported_events[label]);
observed.add(reported_events[label]);
}
}
})();
'''
def __init__(self, story_set, take_memory_measurement):
super(GmailLabelClickStory2020, self).__init__(story_set,
take_memory_measurement)
self.script_to_evaluate_on_commit = js_template.Render(
'''{{@events_and_measures_reported_by_page}}
{{@performance_mark_and_measure}}''',
events_and_measures_reported_by_page=self.
EVENTS_AND_MEASURES_REPORTED_BY_PAGE,
performance_mark_and_measure=self.PERFOMANCE_MARK_AND_MEASURE)
def _Login(self, action_runner):
google_login.NewLoginGoogleAccount(action_runner, 'googletest')
# Navigating to http://mail.google.com immediately leads to an infinite
# redirection loop due to a bug in WPR (see
# https://bugs.chromium.org/p/chromium/issues/detail?id=1036791). We
# therefore first navigate to a dummy sub-URL to set up the session and
# hit the resulting redirection loop. Afterwards, we can safely navigate
# to http://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()
def _DidLoadDocument(self, action_runner):
action_runner.Wait(1)
action_runner.EvaluateJavaScript(
"document.evaluate(\"//span[text()='More']\", "
"document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null)"
".singleNodeValue.click();"
)
action_runner.WaitForElement(selector=self._UPDATES_SELECTOR)
action_runner.ClickElement(selector=self._UPDATES_SELECTOR)
action_runner.WaitForJavaScriptCondition(self.LABEL_CLICK_BEGIN_EVENT)
action_runner.WaitForJavaScriptCondition(self.LABEL_CLICK_END_EVENT)
############################################################################## ##############################################################################
# Google sheets browsing story. # Google sheets browsing story.
############################################################################## ##############################################################################
......
...@@ -49,6 +49,7 @@ browse:social:twitter_infinite_scroll:2018,,desktop,"2018,infinite_scroll" ...@@ -49,6 +49,7 @@ browse:social:twitter_infinite_scroll:2018,,desktop,"2018,infinite_scroll"
browse:tech:discourse_infinite_scroll:2018,,"desktop,mobile","2018,infinite_scroll" browse:tech:discourse_infinite_scroll:2018,,"desktop,mobile","2018,infinite_scroll"
browse:tools:docs_scrolling,Google Docs scrolling story:,desktop,"2020,javascript_heavy" browse:tools:docs_scrolling,Google Docs scrolling story:,desktop,"2020,javascript_heavy"
browse:tools:earth:2020,Load Google Earth and search for the Empire State Building. Watch the,desktop,"2020,keyboard_input,wasm,webgl" browse:tools:earth:2020,Load Google Earth and search for the Empire State Building. Watch the,desktop,"2020,keyboard_input,wasm,webgl"
browse:tools:gmail-labelclick:2020,,desktop,2020
browse:tools:maps:2019,Google maps story:,"desktop,mobile","2019,emerging_market,health_check,javascript_heavy,webgl" browse:tools:maps:2019,Google maps story:,"desktop,mobile","2019,emerging_market,health_check,javascript_heavy,webgl"
browse:tools:sheets:2019,,desktop,"2019,health_check,javascript_heavy" browse:tools:sheets:2019,,desktop,"2019,health_check,javascript_heavy"
browse_accessibility:media:youtube,Tests interacting with the YouTube home page.,desktop,"2016,accessibility,keyboard_input" browse_accessibility:media:youtube,Tests interacting with the YouTube home page.,desktop,"2016,accessibility,keyboard_input"
......
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