Bug 1384272 - Add a talos test that tracks the performance of opening about:preferences; r=jmaher

MozReview-Commit-ID: LuHosK5chMN

--HG--
extra : rebase_source : 2bdf10c088c9a93b91cd09a85f62630c53bd3992
This commit is contained in:
Rob Wood 2018-02-09 18:46:04 -05:00
parent 244e676451
commit 9fd4018d70
7 changed files with 70 additions and 10 deletions

View File

@ -1,11 +1,11 @@
{
"suites": {
"chromez-e10s": {
"tests": ["tresize"]
"tests": ["about_preferences_basic", "tresize"]
},
"chromez-profiling-e10s": {
"talos_options": ["--geckoProfile"],
"tests": ["tresize"]
"tests": [ "about_preferences_basic", "tresize"]
},
"dromaeojs-e10s": {
"tests": ["dromaeo_css", "kraken"]
@ -150,7 +150,7 @@
},
"h1-e10s": {
"tests": ["ts_paint_heavy"]
},
},
"h2-e10s": {
"tests": ["tp6_google_heavy", "tp6_youtube_heavy", "tp6_amazon_heavy", "tp6_facebook_heavy"],
"mitmproxy_release_bin_osx": "mitmproxy-2.0.2-osx.tar.gz",

View File

@ -1,9 +1,8 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var gRetryCounter = 0;
var gErr = "Abort: firstNonBlankPaint value is not available after loading the page";
var gRetryCounter = 0;
function _contentFNBPaintHandler() {
var x = content.window.performance.timing.timeToNonBlankPaint;
@ -11,15 +10,17 @@ function _contentFNBPaintHandler() {
sendAsyncMessage("PageLoader:Error", {"msg": gErr});
}
if (x > 0) {
dump("received fnbpaint value\n");
sendAsyncMessage("PageLoader:LoadEvent", {"time": x,
"name": "fnbpaint"});
gRetryCounter = 0;
} else {
gRetryCounter += 1;
if (gRetryCounter <= 10) {
dump("fnbpaint is not yet available (0), retry number " + gRetryCounter + "...\n");
dump("\nfnbpaint is not yet available (0), retry number " + gRetryCounter + "...\n");
content.setTimeout(_contentFNBPaintHandler, 100);
} else {
dump("unable to get a value for fnbpaint after " + gRetryCounter + " retries\n");
dump("\nunable to get a value for fnbpaint after " + gRetryCounter + " retries\n");
sendAsyncMessage("PageLoader:Error", {"msg": gErr});
}
}

View File

@ -31,6 +31,7 @@ var forceCC = true;
var useMozAfterPaint = false;
var useFNBPaint = false;
var isFNBPaintPending = false;
var useHero = false;
var gPaintWindow = window;
var gPaintListener = false;
@ -311,6 +312,10 @@ function plLoadPage() {
// record which page we are about to open
TalosParentProfiler.mark("Opening " + pages[pageIndex].url.pathQueryRef);
if (useFNBPaint) {
isFNBPaintPending = true;
}
startAndLoadURI(pageName);
}
@ -392,6 +397,14 @@ var plNextPage = async function() {
await waitForIdleCallback();
}
if (useFNBPaint) {
// don't move to next page until we've received fnbpaint
if (isFNBPaintPending) {
dumpLine("Waiting for fnbpaint");
await waitForFNBPaint();
}
}
if (profilingInfo) {
await TalosParentProfiler.finishTest();
}
@ -448,6 +461,19 @@ function plIdleCallbackReceived() {
isIdleCallbackPending = false;
}
function waitForFNBPaint() {
return new Promise(resolve => {
function checkForFNBPaint() {
if (!isFNBPaintPending) {
resolve();
} else {
setTimeout(checkForFNBPaint, 200);
}
}
checkForFNBPaint();
});
}
function forceContentGC() {
return new Promise((resolve) => {
let mm = browserWindow.getBrowser().selectedBrowser.messageManager;
@ -618,6 +644,7 @@ function _loadHandler(paint_time = 0) {
if (paint_time !== 0) {
// window.performance.timing.timeToNonBlankPaint is a timestamp
// this may have a value for hero element (also a timestamp)
end_time = paint_time;
} else {
end_time = Date.now();
@ -645,7 +672,12 @@ function plLoadHandlerMessage(message) {
// we can record several times per load.
if (message.json.time !== undefined) {
paint_time = message.json.time;
if (message.json.name == "fnbpaint") {
// we've received fnbpaint; no longer pending for this current pageload
isFNBPaintPending = false;
}
}
failTimeout.clear();
if ((plPageFlags() & EXECUTE_SCROLL_TEST)) {

View File

@ -67,6 +67,10 @@ Report.prototype.getReport = function() {
report += "|i|pagename|runs|\n";
for (var i = 0; i < pages.length; i++) {
// don't report any measurements that were reported for about:blank
// some tests (like about-preferences) use it as a dummy test page
if (pages[i] == "about:blank")
continue;
report += "|" +
i + ";" +
pages[i].substr(prefixLen) + ";" +

View File

@ -75,9 +75,6 @@ def set_tp_preferences(test, browser_config):
if _pref_name in test['preferences']:
del test['preferences'][_pref_name]
LOG.info("* RW * preferences are now:")
LOG.info(test['preferences'])
def setup_webserver(webserver):
"""use mozhttpd to setup a webserver"""

View File

@ -996,3 +996,22 @@ class rasterflood_gradient(PageloaderTest):
'dom.send_after_paint_to_content': False}
lower_is_better = False
unit = 'score'
@register_test()
class about_preferences_basic(PageloaderTest):
"""
Base class for about_preferences test
"""
tpmanifest = '${talos}/tests/about-preferences/about_preferences_basic.manifest'
# this test uses 'about:blank' as a dummy page (see manifest) so that the pages
# that just change url categories (i.e. about:preferences#search) will get a load event
# also any of the url category pages cannot have more than one tppagecycle
tpcycles = 25
tppagecycles = 1
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

View File

@ -0,0 +1,7 @@
about:preferences
about:blank
about:preferences#search
about:blank
about:preferences#privacy
about:blank
about:preferences#sync