forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1783497 - Don't throw if chrome URL canonicalization fails r=smaug
Looks like this is not needed and making a web-compat issue. Differential Revision: https://phabricator.services.mozilla.com/D156985
- Loading branch information
Showing
6 changed files
with
45 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* Any copyright is dedicated to the Public Domain. | ||
* http://creativecommons.org/publicdomain/zero/1.0/ | ||
*/ | ||
|
||
"use strict"; | ||
|
||
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm"); | ||
|
||
function testURL(url) { | ||
Services.io.newChannelFromURI( | ||
NetUtil.newURI(url), | ||
null, // aLoadingNode | ||
Services.scriptSecurityManager.getSystemPrincipal(), | ||
null, // aTriggeringPrincipal | ||
Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_SEC_CONTEXT_IS_NULL, | ||
Ci.nsIContentPolicy.TYPE_OTHER | ||
); | ||
} | ||
|
||
add_task(async function test_create_channel_with_chrome_url() { | ||
try { | ||
testURL("chrome://path"); | ||
Assert.ok(false); | ||
} catch (e) { | ||
// Chrome url fails canonicalization | ||
Assert.equal(e.result, Cr.NS_ERROR_FAILURE); | ||
} | ||
|
||
try { | ||
testURL("chrome://path/path/path"); | ||
Assert.ok(false); | ||
} catch (e) { | ||
// Chrome url passes canonicalization | ||
Assert.equal(e.result, Cr.NS_ERROR_FILE_NOT_FOUND); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters