summaryrefslogtreecommitdiffstats
path: root/toolkit/components/mozprotocol/tests/browser_mozprotocol.js
blob: 7301d22a885d581fd22bff0fa2c139687aa82353 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// 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.loadURIString(gBrowser, "moz://a");
    await BrowserTestUtils.waitForLocationChange(
      gBrowser,
      `https://example.com/${path}mozprotocol.html`
    );
    ok(true, "Made it to the expected page");
  });
});