diff options
Diffstat (limited to 'toolkit/mozapps/extensions/test/xpinstall/browser_offline.js')
-rw-r--r-- | toolkit/mozapps/extensions/test/xpinstall/browser_offline.js | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/toolkit/mozapps/extensions/test/xpinstall/browser_offline.js b/toolkit/mozapps/extensions/test/xpinstall/browser_offline.js index eb4ac391f..28f3497d1 100644 --- a/toolkit/mozapps/extensions/test/xpinstall/browser_offline.js +++ b/toolkit/mozapps/extensions/test/xpinstall/browser_offline.js @@ -1,4 +1,4 @@ -var proxyPrefValue; +let proxyPrefValue; // ---------------------------------------------------------------------------- // Tests that going offline cancels an in progress download. @@ -11,7 +11,7 @@ function test() { pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION); var triggers = encodeURIComponent(JSON.stringify({ - "Unsigned XPI": TESTROOT + "amosigned.xpi" + "Unsigned XPI": TESTROOT + "unsigned.xpi" })); gBrowser.selectedTab = gBrowser.addTab(); gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers); @@ -34,10 +34,9 @@ function finish_test(count) { info("Checking if the browser is still offline..."); let tab = gBrowser.selectedTab; - ContentTask.spawn(tab.linkedBrowser, null, function*() { - yield ContentTaskUtils.waitForEvent(this, "DOMContentLoaded", true); - return content.document.documentURI; - }).then(url => { + tab.linkedBrowser.addEventListener("DOMContentLoaded", function errorLoad() { + tab.linkedBrowser.removeEventListener("DOMContentLoaded", errorLoad, true); + let url = tab.linkedBrowser.contentDocument.documentURI; info("loaded: " + url); if (/^about:neterror\?e=netOffline/.test(url)) { wait_for_online(); @@ -45,7 +44,7 @@ function finish_test(count) { gBrowser.removeCurrentTab(); Harness.finish(); } - }); + }, true); tab.linkedBrowser.loadURI("http://example.com/"); } @@ -56,7 +55,7 @@ function finish_test(count) { } catch (ex) { } - Services.perms.remove(makeURI("http://example.com"), "install"); + Services.perms.remove("example.com", "install"); wait_for_online(); } |