gecko-dev/toolkit/components/mozprotocol/tests/browser_mozprotocol.js
Marco Bonardo 70fdad6676 Bug 1852963 - Rename BrowserTestUtils.loadURIString() to .startLoadingURIString(). r=dao
This should make a bit clearer that it is only starting the load, not waiting
for its completion.

Differential Revision: https://phabricator.services.mozilla.com/D188213
2023-09-15 09:16:34 +00:00

23 lines
689 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.startLoadingURIString(gBrowser, "moz://a");
await BrowserTestUtils.waitForLocationChange(
gBrowser,
`https://example.com/${path}mozprotocol.html`
);
ok(true, "Made it to the expected page");
});
});