Files
tubestation/toolkit/components/mozprotocol/tests/browser_mozprotocol.js
Dave Townsend 4b494969dc Bug 1331968: Implement the moz: protocol handler to redirect to a fixed website. r=gijs
The protocol handler is intentionally simple. It works for the entering into the
urlbar case but not a lot else. Included some basic tests.

MozReview-Commit-ID: 4FQ1irdt3Nj
2017-01-18 14:10:46 -08:00

15 lines
587 B
JavaScript

// 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");
});
});