Bug 1305204 - (Part 2) Backout bug 1275746 a=backout

MozReview-Commit-ID: H8aCKdJzEbR
This commit is contained in:
Valentin Gosu 2016-10-23 14:24:45 +02:00
Родитель 99164c0eef
Коммит db9440de51
9 изменённых файлов: 35 добавлений и 21 удалений

Просмотреть файл

@ -426,6 +426,8 @@ var testcases = [ {
protocolChange: true,
}, {
input: "?'.com",
fixedURI: "http:///?%27.com",
alternateURI: "http://www..com/?%27.com",
keywordLookup: true,
protocolChange: true,
}, {
@ -434,10 +436,14 @@ var testcases = [ {
protocolChange: true
}, {
input: "?mozilla",
fixedURI: "http:///?mozilla",
alternateURI: "http://www..com/?mozilla",
keywordLookup: true,
protocolChange: true,
}, {
input: "??mozilla",
fixedURI: "http:///??mozilla",
alternateURI: "http://www..com/??mozilla",
keywordLookup: true,
protocolChange: true,
}, {

Просмотреть файл

@ -154,14 +154,13 @@ function checkInputURL()
sendString("ttp://mozilla.org");
checkValidApplies(element);
for (var i=0; i<10; ++i) {
for (var i=0; i<13; ++i) {
synthesizeKey("VK_BACK_SPACE", {});
checkValidApplies(element);
}
synthesizeKey("VK_BACK_SPACE", {});
// "http://" is now invalid
for (var i=0; i<7; ++i) {
for (var i=0; i<4; ++i) {
checkInvalidApplies(element);
synthesizeKey("VK_BACK_SPACE", {});
}

Просмотреть файл

@ -387,17 +387,5 @@
url = new URL("scheme://tmp\\test", base);
is(url.href, "scheme://tmp\\test");
</script>
<script>
/** Test for Bug 1275746 **/
SimpleTest.doesThrow(() => { var url = new URL("http:"); }, "http: is not a valid URL");
SimpleTest.doesThrow(() => { var url = new URL("http:///"); }, "http: is not a valid URL");
var url = new URL("file:");
is(url.href, "file:///", "Parsing file: should work.");
url = new URL("file:///");
is(url.href, "file:///", "Parsing file:/// should work.");
</script>
</body>
</html>

Просмотреть файл

@ -79,10 +79,23 @@ function run_test() {
cm.removeAll();
// test that setting an empty or '.' http:// host results in a no-op
var uri = NetUtil.newURI("http://baz.com/");
var emptyuri = NetUtil.newURI("http:///");
var doturi = NetUtil.newURI("http://./");
do_check_eq(uri.asciiHost, "baz.com");
do_check_eq(emptyuri.asciiHost, "");
do_check_eq(doturi.asciiHost, ".");
cs.setCookieString(emptyuri, null, "foo2=bar", null);
do_check_eq(getCookieCount(), 0);
cs.setCookieString(doturi, null, "foo3=bar", null);
do_check_eq(getCookieCount(), 0);
cs.setCookieString(uri, null, "foo=bar", null);
do_check_eq(getCookieCount(), 1);
do_check_eq(cs.getCookieString(uri, null), "foo=bar");
do_check_eq(cs.getCookieString(emptyuri, null), null);
do_check_eq(cs.getCookieString(doturi, null), null);
do_check_eq(cm.countCookiesFromHost(""), 0);
do_check_throws(function() {

Просмотреть файл

@ -143,7 +143,7 @@ add_test(function serverErrorResponse () {
add_test(function networkErrorResponse () {
let client = new FxAccountsOAuthGrantClient({
serverURL: "http://domain.dummy",
serverURL: "http://",
client_id: "abc123"
});
Services.prefs.setBoolPref("identity.fxaccounts.skipDeviceRegistration", true);

Просмотреть файл

@ -268,7 +268,7 @@ add_test(function server401ResponsePersists () {
add_test(function networkErrorResponse () {
let client = new FxAccountsProfileClient({
serverURL: "http://domain.dummy",
serverURL: "http://",
fxa: mockFxa,
});
client.fetchProfile()

Просмотреть файл

@ -0,0 +1,10 @@
[open-url-bogus.htm]
type: testharness
[XMLHttpRequest: open() - bogus URLs (http:)]
expected: FAIL
[XMLHttpRequest: open() - bogus URLs (ftp:)]
expected: FAIL
[XMLHttpRequest: open() - bogus URLs (http:////////////)]
expected: FAIL

Просмотреть файл

@ -246,3 +246,5 @@
[Parsing: <http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar> against <about:blank>]
expected: FAIL
[Parsing: <http:> against <https://example.org/foo/bar>]
expected: FAIL

Просмотреть файл

@ -107,10 +107,6 @@ add_task(function* test_searchEngine_www_noautofill() {
});
add_task(function* test_searchEngine_different_scheme_noautofill() {
// TODO: this test is disabled because of bug 1275746
return;
Services.prefs.setBoolPref("browser.urlbar.autoFill.searchEngines", true);
Services.search.addEngineWithDetails("PieSearch", "", "", "",
"GET", "https://pie.search/");