summaryrefslogtreecommitdiffstats
path: root/toolkit/components/mozprotocol/tests/browser_mozprotocol.js
blob: 795ce8a08c5463f264b3f840f5ea1411437b3f67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Check that entering moz://a into the address bar directs us to a new url
add_task(function*() {
  let path = getRootDirectory(gTestPath).substring("chrome://mochitests/content/".length);
  yield SpecialPowers.pushPrefEnv({
    set: [["toolkit.mozprotocol.url", `https://example.com/${path}mozprotocol.html`]],
  });

  yield BrowserTestUtils.withNewTab("about:blank", function*() {
    gBrowser.loadURI("moz://a");
    yield BrowserTestUtils.waitForLocationChange(gBrowser,
      `https://example.com/${path}mozprotocol.html`);
    ok(true, "Made it to the expected page");
  });
});