gecko-dev/toolkit/components/mozprotocol/tests/browser_mozprotocol.js
Jonathan Kingston c7c96baf75 Bug 1485305 - toolkit/ Ensure loadURI always passes a triggeringPrincipal() r=Mossop
Differential Revision: https://phabricator.services.mozilla.com/D4563

--HG--
extra : source : 390737876a61c5da48a1957d284d3c315fbd541a
extra : intermediate-source : f0b190c1cfb5d2df482f1051bbc0ff98de71235b
2018-08-29 15:49:12 +01:00

14 lines
615 B
JavaScript

// Check that entering moz://a into the address bar directs us to a new url
add_task(async function() {
let path = getRootDirectory(gTestPath).substring("chrome://mochitests/content/".length);
await SpecialPowers.pushPrefEnv({
set: [["toolkit.mozprotocol.url", `https://example.com/${path}mozprotocol.html`]],
});
await BrowserTestUtils.withNewTab("about:blank", async function() {
BrowserTestUtils.loadURI(gBrowser, "moz://a");
await BrowserTestUtils.waitForLocationChange(gBrowser,
`https://example.com/${path}mozprotocol.html`);
ok(true, "Made it to the expected page");
});
});