Bug 1362410 - Make the setTimeout run on the same target as HistoryTracker. r?smaug
MozReview-Commit-ID: KvcFxG7RMNZ
--- a/docshell/test/browser/browser_bug1347823.js
+++ b/docshell/test/browser/browser_bug1347823.js
@@ -47,18 +47,20 @@ add_task(async function testExpiredCache
content.document.body.textContent = "modified";
});
// Load a random page.
BrowserTestUtils.loadURI(browser, "data:text/html;charset=utf-8,page2");
await BrowserTestUtils.browserLoaded(browser);
// Wait for 3 times of expiration timeout, hopefully it's evicted...
- await new Promise(resolve => {
- setTimeout(resolve, 3000);
+ await ContentTask.spawn(browser, null, () => {
+ return new Promise(resolve => {
+ content.setTimeout(resolve, 3000);
+ });
});
// Go back and verify text content.
let awaitPageShow = BrowserTestUtils.waitForContentEvent(browser, "pageshow");
browser.goBack();
await awaitPageShow;
await ContentTask.spawn(browser, null, () => {
is(content.document.body.textContent, "page1");