Bug 1690134 - Fix flakiness in browser_history_persist.js, r=annyG

Waiting for the about:robots load explicitly ensures we don't proceed until all
history changes have fully propagated.

Differential Revision: https://phabricator.services.mozilla.com/D113686
This commit is contained in:
Kashav Madan
2021-04-28 21:49:15 +00:00
parent 49c72ce0fd
commit 2fdef46f8f

View File

@@ -50,7 +50,7 @@ add_task(async function check_history_not_persisted() {
// Load a new URL into the tab, it should replace the about:blank history entry
BrowserTestUtils.loadURI(browser, "about:robots");
await promiseBrowserLoaded(browser);
await promiseBrowserLoaded(browser, false, "about:robots");
if (!SpecialPowers.Services.appinfo.sessionHistoryInParent) {
await SpecialPowers.spawn(browser, [], function() {
let sessionHistory =
@@ -124,7 +124,7 @@ add_task(async function check_history_default_persisted() {
// Load a new URL into the tab, it should replace the about:blank history entry
BrowserTestUtils.loadURI(browser, "about:robots");
await promiseBrowserLoaded(browser);
await promiseBrowserLoaded(browser, false, "about:robots");
if (!SpecialPowers.Services.appinfo.sessionHistoryInParent) {
await SpecialPowers.spawn(browser, [], function() {
let sessionHistory =