mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1624550 - P5: Fix racy check for SessionHistory update. r=kmag
This code was relying on SessionHistory update having completed when GlobalHistory is update. Moving GlobalHistory update to the parent process with DocumentChannel means that it's possible for the GlobalHistory event to fire before the SessionHistory is updated in nsDocShell. Switch to using tab loading complete to signal when it's OK to check SessionHistory. Differential Revision: https://phabricator.services.mozilla.com/D72280
This commit is contained in:
parent
7699520bf5
commit
d35dd7a81d
@ -148,7 +148,7 @@ add_task(async function test_update_reload() {
|
||||
|
||||
let extension = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
permissions: ["tabs", "history"],
|
||||
permissions: ["tabs"],
|
||||
},
|
||||
|
||||
background() {
|
||||
@ -157,9 +157,15 @@ add_task(async function test_update_reload() {
|
||||
browser.test.sendMessage("result", result);
|
||||
});
|
||||
|
||||
browser.history.onVisited.addListener(data => {
|
||||
browser.test.sendMessage("historyAdded");
|
||||
});
|
||||
const filter = {
|
||||
properties: ["status"],
|
||||
};
|
||||
|
||||
browser.tabs.onUpdated.addListener((tabId, changeInfo) => {
|
||||
if (changeInfo.status === "complete") {
|
||||
browser.test.sendMessage("historyAdded");
|
||||
}
|
||||
}, filter);
|
||||
},
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user