зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 4 changesets (bug 1517025) for multiple failures e.g.: toolkit/components/telemetry/tests/unit/test_PingAPI.js CLOSED TREE
Backed out changeset 1e173178e49f (bug 1517025) Backed out changeset c29889dea969 (bug 1517025) Backed out changeset 48c7d643d2fa (bug 1517025) Backed out changeset 419cb778d531 (bug 1517025)
This commit is contained in:
Родитель
d08e2d743a
Коммит
ca2235a67e
|
@ -1,5 +0,0 @@
|
|||
<html>
|
||||
<body>
|
||||
<iframe src="/\b%9ª">
|
||||
</body>
|
||||
</html>
|
|
@ -249,4 +249,3 @@ load 1516560.html
|
|||
load structured_clone_container_throws.html
|
||||
load xhr_empty_datauri.html
|
||||
load xhr_html_nullresponse.html
|
||||
load 1517025.html
|
||||
|
|
|
@ -60,6 +60,10 @@ const char nsStandardURL::gHostLimitDigits[] = {'/', '\\', '?', '#', 0};
|
|||
bool nsStandardURL::gPunycodeHost = true;
|
||||
|
||||
// Invalid host characters
|
||||
// We still allow % because it is in the ID of addons.
|
||||
// Any percent encoded ASCII characters that are not allowed in the
|
||||
// hostname are not percent decoded, and will be parsed just fine.
|
||||
//
|
||||
// Note that the array below will be initialized at compile time,
|
||||
// so we do not need to "optimize" TestForInvalidHostCharacters.
|
||||
//
|
||||
|
@ -69,7 +73,7 @@ constexpr bool TestForInvalidHostCharacters(char c) {
|
|||
return (c > 0 && c < 32) || // The control characters are [1, 31]
|
||||
c == ' ' || c == '#' || c == '/' || c == ':' || c == '?' || c == '@' ||
|
||||
c == '[' || c == '\\' || c == ']' || c == '*' || c == '<' ||
|
||||
c == '>' || c == '|' || c == '"' || c == '%';
|
||||
c == '>' || c == '|' || c == '"';
|
||||
}
|
||||
constexpr ASCIIMaskArray sInvalidHostChars =
|
||||
CreateASCIIMask(TestForInvalidHostCharacters);
|
||||
|
|
|
@ -29,17 +29,17 @@ function run_test() {
|
|||
newURI = newURI.mutate().setSpec("http://example.com/foo").finalize();
|
||||
Assert.equal(newURI.asciiHost, "example.com");
|
||||
|
||||
// Characters that are invalid in the host
|
||||
Assert.throws(() => { newURI = newURI.mutate().setSpec("http://example.com%3ffoo").finalize(); },
|
||||
/NS_ERROR_MALFORMED_URI/, "bad escaped character");
|
||||
Assert.throws(() => { newURI = newURI.mutate().setSpec("http://example.com%23foo").finalize(); },
|
||||
/NS_ERROR_MALFORMED_URI/, "bad escaped character");
|
||||
Assert.throws(() => { newURI = newURI.mutate().setSpec("http://example.com%3bfoo").finalize(); },
|
||||
/NS_ERROR_MALFORMED_URI/, "bad escaped character");
|
||||
Assert.throws(() => { newURI = newURI.mutate().setSpec("http://example.com%3a80").finalize(); },
|
||||
/NS_ERROR_MALFORMED_URI/, "bad escaped character");
|
||||
Assert.throws(() => { newURI = newURI.mutate().setSpec("http://example.com%2ffoo").finalize(); },
|
||||
/NS_ERROR_MALFORMED_URI/, "bad escaped character");
|
||||
Assert.throws(() => { newURI = newURI.mutate().setSpec("http://example.com%00").finalize(); },
|
||||
/NS_ERROR_MALFORMED_URI/, "bad escaped character");
|
||||
// Characters that are invalid in the host, shouldn't be decoded.
|
||||
newURI = newURI.mutate().setSpec("http://example.com%3ffoo").finalize();
|
||||
Assert.equal(newURI.asciiHost, "example.com%3ffoo");
|
||||
newURI = newURI.mutate().setSpec("http://example.com%23foo").finalize();
|
||||
Assert.equal(newURI.asciiHost, "example.com%23foo");
|
||||
newURI = newURI.mutate().setSpec("http://example.com%3bfoo").finalize();
|
||||
Assert.equal(newURI.asciiHost, "example.com%3bfoo");
|
||||
newURI = newURI.mutate().setSpec("http://example.com%3a80").finalize();
|
||||
Assert.equal(newURI.asciiHost, "example.com%3a80");
|
||||
newURI = newURI.mutate().setSpec("http://example.com%2ffoo").finalize();
|
||||
Assert.equal(newURI.asciiHost, "example.com%2ffoo");
|
||||
newURI = newURI.mutate().setSpec("http://example.com%00").finalize();
|
||||
Assert.equal(newURI.asciiHost, "example.com%00");
|
||||
}
|
||||
|
|
|
@ -5,13 +5,11 @@
|
|||
let reference = [
|
||||
["www.example.com%e2%88%95www.mozill%d0%b0.com%e2%81%84www.mozilla.org",
|
||||
"www.example.xn--comwww-re3c.xn--mozill-8nf.xn--comwww-rq0c.mozilla.org"],
|
||||
["www.mozill%61%2f.org", "www.mozilla%2f.org"], // a slash is not valid in the hostname
|
||||
["www.e%00xample.com%e2%88%95www.mozill%d0%b0.com%e2%81%84www.mozill%61.org",
|
||||
"www.e%00xample.xn--comwww-re3c.xn--mozill-8nf.xn--comwww-rq0c.mozilla.org"],
|
||||
];
|
||||
|
||||
let badURIs = [
|
||||
["www.mozill%61%2f.org"], // a slash is not valid in the hostname
|
||||
["www.e%00xample.com%e2%88%95www.mozill%d0%b0.com%e2%81%84www.mozill%61.org"],
|
||||
]
|
||||
|
||||
let prefData =
|
||||
[
|
||||
{
|
||||
|
@ -77,9 +75,4 @@ function run_test() {
|
|||
ok(false, "Error testing "+reference[i][0]);
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < badURIs.length; ++i) {
|
||||
Assert.throws(() => { let result = stringToURL("http://" + badURIs[i][0]).host; },
|
||||
/NS_ERROR_MALFORMED_URI/, "bad escaped character");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
"use strict";
|
||||
|
||||
ChromeUtils.import('resource://gre/modules/Services.jsm');
|
||||
const gPrefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
|
||||
|
||||
function symmetricEquality(expect, a, b)
|
||||
|
@ -313,9 +312,9 @@ add_test(function test_percentDecoding()
|
|||
var url = stringToURL("http://%70%61%73%74%65%62%69%6E.com");
|
||||
Assert.equal(url.spec, "http://pastebin.com/");
|
||||
|
||||
// Disallowed hostname characters are rejected even when percent encoded
|
||||
Assert.throws(() => { url = stringToURL("http://example.com%0a%23.google.com/"); },
|
||||
/NS_ERROR_MALFORMED_URI/, "invalid characters are not allowed");
|
||||
// We shouldn't unescape characters that are not allowed in the hostname.
|
||||
url = stringToURL("http://example.com%0a%23.google.com/");
|
||||
Assert.equal(url.spec, "http://example.com%0a%23.google.com/");
|
||||
run_next_test();
|
||||
});
|
||||
|
||||
|
@ -697,17 +696,3 @@ add_test(function test_idna_host() {
|
|||
|
||||
run_next_test();
|
||||
});
|
||||
|
||||
add_test(function test_bug1517025() {
|
||||
Assert.throws(() => { let other = stringToURL("https://b%9a/"); },
|
||||
/NS_ERROR_UNEXPECTED/, "bad URI");
|
||||
|
||||
Assert.throws(() => { let other = stringToURL("https://b%9ª/"); },
|
||||
/NS_ERROR_MALFORMED_URI/, "bad URI");
|
||||
|
||||
let base = stringToURL("https://bug1517025.bmoattachments.org/attachment.cgi?id=9033787");
|
||||
Assert.throws(() => { let uri = Services.io.newURI("/\\b%9ª", "windows-1252", base); },
|
||||
/NS_ERROR_MALFORMED_URI/, "bad URI");
|
||||
|
||||
run_next_test();
|
||||
});
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
// Base preferences file used by the xpcshell harness
|
||||
/* globals user_pref */
|
||||
/* eslint quotes: 0 */
|
||||
user_pref("app.normandy.api_url", "https://localhost/selfsupport-dummy/");
|
||||
user_pref("browser.safebrowsing.downloads.remote.url", "https://localhost/safebrowsing-dummy");
|
||||
user_pref("browser.search.geoip.url", "https://localhost/geoip-dummy");
|
||||
user_pref("extensions.systemAddon.update.url", "http://localhost/dummy-system-addons.xml");
|
||||
user_pref("app.normandy.api_url", "https://%(server)s/selfsupport-dummy/");
|
||||
user_pref("browser.safebrowsing.downloads.remote.url", "https://%(server)s/safebrowsing-dummy");
|
||||
user_pref("browser.search.geoip.url", "https://%(server)s/geoip-dummy");
|
||||
user_pref("extensions.systemAddon.update.url", "http://%(server)s/dummy-system-addons.xml");
|
||||
// Always use network provider for geolocation tests
|
||||
// so we bypass the OSX dialog raised by the corelocation provider
|
||||
user_pref("geo.provider.testing", true);
|
||||
user_pref("media.gmp-manager.updateEnabled", false);
|
||||
user_pref("media.gmp-manager.url.override", "http://localhost/dummy-gmp-manager.xml");
|
||||
user_pref("toolkit.telemetry.server", "https://localhost/telemetry-dummy");
|
||||
user_pref("media.gmp-manager.url.override", "http://%(server)s/dummy-gmp-manager.xml");
|
||||
user_pref("toolkit.telemetry.server", "https://%(server)s/telemetry-dummy");
|
||||
// The process priority manager only shifts priorities when it has at least
|
||||
// one active tab. xpcshell tabs don't have any active tabs, which would mean
|
||||
// all processes would run at low priority, which is not desirable, so we
|
||||
|
|
|
@ -89,9 +89,33 @@
|
|||
[Parsing: <http://%ef%b7%90zyx.com> against <http://other.com/>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http://%41.com> against <http://other.com/>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http://%ef%bc%85%ef%bc%94%ef%bc%91.com> against <http://other.com/>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http://%00.com> against <http://other.com/>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http://%ef%bc%85%ef%bc%90%ef%bc%90.com> against <http://other.com/>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http://%zz%66%a.com> against <http://other.com/>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http://%25> against <http://other.com/>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http://hello%00> against <http://other.com/>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http://192.168.0.257> against <http://other.com/>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http://%3g%78%63%30%2e%30%32%35%30%2E.01> against <http://other.com/>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <i> against <sc:/pa/pa>]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -423,9 +447,15 @@
|
|||
[Parsing: <sc://ñ#x> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http://%00.com> against <http://other.com/>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <x> against <sc://ñ>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http://%41.com> against <http://other.com/>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http://zyx.com> against <http://other.com/>]
|
||||
expected: FAIL
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче