Skip to content

Commit

Permalink
Bug 1600339 - Measure responsiveness while evaluating messages r=k88h…
Browse files Browse the repository at this point in the history
…udson,mconley

Differential Revision: https://phabricator.services.mozilla.com/D59535

--HG--
extra : moz-landing-system : lando
  • Loading branch information
piatra committed Jan 18, 2020
1 parent 1e2da20 commit a1f1d61
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 1 deletion.
1 change: 1 addition & 0 deletions .hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ _OPT\.OBJ/
^testing/talos/talos/tests/devtools/damp.manifest.develop
^testing/talos/talos/startup_test/startup_about_home_paint/startup_about_home_paint.manifest.develop
^testing/talos/talos/webextensions/
^testing/talos/talos/tests/about-newtab/about_newtab.manifest.develop
^talos-venv
^py3venv
^testing/talos/talos/mitmproxy/mitmdump
Expand Down
15 changes: 15 additions & 0 deletions browser/components/newtab/lib/ASRouter.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,19 @@ const MessageLoaderUtils = {
return provider.messages;
},

async _localJsonLoader(provider) {
let payload;
try {
payload = await (await fetch(provider.location, {
credentials: "omit",
})).json();
} catch (e) {
return [];
}

return payload.messages;
},

async _remoteLoaderCache(storage) {
let allCached;
try {
Expand Down Expand Up @@ -344,6 +357,8 @@ const MessageLoaderUtils = {
return this._remoteLoader;
case "remote-settings":
return this._remoteSettingsLoader;
case "json":
return this._localJsonLoader;
case "local":
default:
return this._localLoader;
Expand Down
2 changes: 1 addition & 1 deletion testing/talos/talos.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"tests": ["basic_compositor_video"]
},
"chromez": {
"tests": ["about_preferences_basic", "tresize"]
"tests": ["about_preferences_basic", "tresize", "about_newtab_with_snippets"]
},
"dromaeojs": {
"tests": ["dromaeo_css", "kraken"]
Expand Down
25 changes: 25 additions & 0 deletions testing/talos/talos/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1010,3 +1010,28 @@ class about_preferences_basic(PageloaderTest):
unit = 'ms'
lower_is_better = True
fnbpaint = True


@register_test()
class about_newtab_with_snippets(PageloaderTest):
"""
Load about ActivityStream (about:home and about:newtab) with snippets enabled
"""
tpmanifest = '${talos}/tests/about-newtab/about_newtab.manifest'
tpcycles = 25
tppagecycles = 1
responsiveness = True
gecko_profile_interval = 1
gecko_profile_entries = 2000000
filters = filter.ignore_first.prepare(5) + filter.median.prepare()
unit = 'ms'
lower_is_better = True
fnbpaint = True
preferences = {
# ensure that snippets are turned on and load the json messages
'browser.newtabpage.activity-stream.asrouter.providers.snippets':\
'{"id":"snippets","enabled":true,"type":"json","location":\
"http://fakedomain/tests/about-newtab/snippets.json",\
"updateCycleInMs":14400000}',
'browser.newtabpage.activity-stream.feeds.snippets': True
}
6 changes: 6 additions & 0 deletions testing/talos/talos/tests/about-newtab/about_newtab.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
about:newtab
about:home
about:newtab
about:home
about:newtab
about:home
1 change: 1 addition & 0 deletions testing/talos/talos/tests/about-newtab/snippets.json

Large diffs are not rendered by default.

0 comments on commit a1f1d61

Please sign in to comment.