Bug 1717872 - Fix browser_ext_tabs_discard_reversed test with Fission and SHIP r=robwu

Since this is testing undesired but previously consistent behavior, I'm just
relaxing the (sometimes) expected results with Fission SHIP.

Differential Revision: https://phabricator.services.mozilla.com/D120798
This commit is contained in:
Tomislav Jovanovic
2021-07-27 17:56:01 +00:00
parent 7e8a6c5905
commit 78839621be
2 changed files with 18 additions and 2 deletions

View File

@@ -230,7 +230,6 @@ skip-if = os == "linux" && debug && bits == 32 # Bug 1350189
[browser_ext_tabs_discard.js]
skip-if = !e10s
[browser_ext_tabs_discard_reversed.js]
skip-if = fission # bug 1717872
[browser_ext_tabs_discarded.js]
[browser_ext_tabs_duplicate.js]
[browser_ext_tabs_events.js]

View File

@@ -8,6 +8,13 @@ add_task(async function tabs_discarded_load_and_discard() {
permissions: ["tabs", "webNavigation"],
},
async background() {
browser.test.sendMessage("ready");
const SHIP = await new Promise(resolve =>
browser.test.onMessage.addListener((msg, data) => {
resolve(data);
})
);
const PAGE_URL_BEFORE = "http://example.com/initiallyDiscarded";
const PAGE_URL =
"http://example.com/browser/browser/components/extensions/test/browser/file_dummy.html";
@@ -67,8 +74,16 @@ add_task(async function tabs_discarded_load_and_discard() {
// requested URL and its title. However, the current implementation
// reports several events (including url/title "changes") as part of
// "restoring" the lazy browser prior to loading the requested URL.
let expectedUrlChanges = [PAGE_URL_BEFORE, PAGE_URL];
if (SHIP && observedChanges.url.length === 1) {
// Except when SHIP is enabled, which turns this into a race,
// so sometimes only the final URL is seen (see bug 1696815#c22).
expectedUrlChanges = [PAGE_URL];
}
assertDeepEqual(
[PAGE_URL_BEFORE, PAGE_URL],
expectedUrlChanges,
observedChanges.url,
"changes to tab.url after update"
);
@@ -109,6 +124,8 @@ add_task(async function tabs_discarded_load_and_discard() {
});
await extension.startup();
await extension.awaitMessage("ready");
extension.sendMessage("SHIP", Services.appinfo.sessionHistoryInParent);
await extension.awaitMessage("done");
await extension.unload();
});