зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 21aedccf1abb (bug 1353429) for ESlint failure. CLOSED TREE
This commit is contained in:
Родитель
7e653b89c7
Коммит
426b685bf7
|
@ -1,39 +0,0 @@
|
|||
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
var ssm = Services.scriptSecurityManager;
|
||||
|
||||
function makeURI(uri) {
|
||||
return Services.io.newURI(uri);
|
||||
}
|
||||
|
||||
function createPrincipal(aURI) {
|
||||
try {
|
||||
var uri = makeURI(aURI);
|
||||
var principal = ssm.createContentPrincipal(uri, {});
|
||||
return principal;
|
||||
} catch(e) {
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
Assert.equal(
|
||||
createPrincipal("http://test^test/foo^bar#x^y"),
|
||||
null
|
||||
);
|
||||
|
||||
Assert.equal(
|
||||
createPrincipal("http://test^test/foo\\bar"),
|
||||
null
|
||||
);
|
||||
|
||||
Assert.equal(
|
||||
createPrincipal("http://test:2^3/foo\\bar"),
|
||||
null
|
||||
);
|
||||
Assert.equal(
|
||||
createPrincipal("http://test/foo^bar").exposableSpec,
|
||||
"http://test/foo%5Ebar"
|
||||
);
|
||||
|
||||
}
|
|
@ -2,5 +2,4 @@
|
|||
head =
|
||||
|
||||
[test_origin.js]
|
||||
[test_uri_escaping.js]
|
||||
[test_ipv6_host_literal.js]
|
||||
|
|
Загрузка…
Ссылка в новой задаче