Bug 1674827 - Make sure getInfo.html waits for about:newtab's TopSitesFeed to finish initting when setting up a Talos test. r=perftest-reviewers,sparky

There was also a bug where the TalosPowersGoQuitApplication event detail was
being treated as an object even though it was actually a boolean.

This also re-enables the startup_about_home_paint_cached which was failing
intermittently because of these bugs.

Differential Revision: https://phabricator.services.mozilla.com/D137057
This commit is contained in:
Mike Conley 2022-01-28 14:40:27 +00:00
Родитель fff697ff74
Коммит 1ef3f3acc4
4 изменённых файлов: 25 добавлений и 6 удалений

Просмотреть файл

@ -13,8 +13,7 @@
"tests": ["tart_flex", "ts_paint_flex"]
},
"other": {
"_comment": "Bug 1220362 - Disabled startup_about_home_paint_cached for high frequency intermittents",
"tests": ["a11yr", "ts_paint", "twinopen", "sessionrestore", "sessionrestore_no_auto_restore", "tabpaint", "cpstartup", "startup_about_home_paint", "pdfpaint", "cross_origin_pageload"]
"tests": ["a11yr", "ts_paint", "twinopen", "sessionrestore", "sessionrestore_no_auto_restore", "tabpaint", "cpstartup", "startup_about_home_paint", "pdfpaint", "cross_origin_pageload", "startup_about_home_paint_cached"]
},
"sessionrestore-many-windows": {
"tests": ["sessionrestore_many_windows"]

Просмотреть файл

@ -29,7 +29,7 @@
// dump(`\tBrowser outer width/height: ${window.outerWidth}/${window.outerHeight}`);
dump("\n__metrics\n");
TalosPowersParent.exec("dumpAboutSupport");
TalosPowersContent.goQuitApplication(true);
TalosPowersContent.goQuitApplication(true /* waitForStartupFinished */);
});
</script>

Просмотреть файл

@ -8,6 +8,8 @@ const { ComponentUtils } = ChromeUtils.import(
"resource://gre/modules/ComponentUtils.jsm"
);
XPCOMUtils.defineLazyModuleGetters(this, {
AboutHomeStartupCache: "resource:///modules/BrowserGlue.jsm",
AboutNewTab: "resource:///modules/AboutNewTab.jsm",
BrowserWindowTracker: "resource:///modules/BrowserWindowTracker.jsm",
OS: "resource://gre/modules/osfile.jsm",
PerTestCoverageUtils: "resource://testing-common/PerTestCoverageUtils.jsm",
@ -264,7 +266,10 @@ TalosPowersService.prototype = {
},
async forceQuit(messageData) {
if (messageData && messageData.waitForSafeBrowsing) {
if (messageData && messageData.waitForStartupFinished) {
// We can wait for various startup items here to complete during
// the getInfo.html step for Talos so that subsequent runs don't
// have to do things like re-request the SafeBrowsing list.
let SafeBrowsing = ChromeUtils.import(
"resource://gre/modules/SafeBrowsing.jsm",
{}
@ -278,6 +283,21 @@ TalosPowersService.prototype = {
} catch (e) {
// We don't care if things go wrong here - let's just shut down.
}
// We wait for the AboutNewTab's TopSitesFeed (and its "Contile"
// integration, which shows the sponsored Top Sites) to finish
// being enabled here. This is because it's possible for getInfo.html
// to run so quickly that the feed will still be initializing, and
// that would cause us to write a mostly empty cache to the
// about:home startup cache on shutdown, which causes that test
// to break periodically.
AboutNewTab.onBrowserReady();
let feed = AboutNewTab.activityStream.store.feeds.get(
"feeds.system.topsites"
);
await feed._contile.refresh();
await feed.refresh({ broadcast: true });
await AboutHomeStartupCache.cacheNow();
}
// Check to see if the top-most browser window still needs to fire its

Просмотреть файл

@ -96,10 +96,10 @@ var TalosPowersParent;
document.dispatchEvent(event);
},
goQuitApplication(waitForSafeBrowsing) {
goQuitApplication(waitForStartupFinished) {
var event = new CustomEvent("TalosPowersGoQuitApplication", {
bubbles: true,
detail: waitForSafeBrowsing,
detail: { waitForStartupFinished },
});
document.dispatchEvent(event);
},