Bug 1305204 - (Part 2) Backout bug 1275746 a=backout draft
authorValentin Gosu <valentin.gosu@gmail.com>
Mon, 24 Oct 2016 23:01:08 +0200
changeset 428982 160f1c56c493752d5b822d8369603d75f4846185
parent 428981 4301f341f67ab6db9b05cbaeb9698aaebad206d2
child 428983 8c51dbbb7db324cc0226ac86e13c111cad79744f
push id33448
push uservalentin.gosu@gmail.com
push dateMon, 24 Oct 2016 21:36:18 +0000
reviewersbackout
bugs1305204, 1275746
milestone50.0
Bug 1305204 - (Part 2) Backout bug 1275746 a=backout MozReview-Commit-ID: H8aCKdJzEbR
docshell/test/unit/test_nsDefaultURIFixup_info.js
dom/html/test/test_bug558788-1.html
dom/url/tests/test_url.html
extensions/cookie/test/unit/test_bug526789.js
services/fxaccounts/tests/xpcshell/test_oauth_grant_client.js
services/fxaccounts/tests/xpcshell/test_profile_client.js
testing/web-platform/meta/XMLHttpRequest/open-url-bogus.htm.ini
testing/web-platform/meta/url/url-constructor.html.ini
toolkit/components/places/tests/unifiedcomplete/test_avoid_middle_complete.js
--- a/docshell/test/unit/test_nsDefaultURIFixup_info.js
+++ b/docshell/test/unit/test_nsDefaultURIFixup_info.js
@@ -424,28 +424,34 @@ var testcases = [ {
     protocolChange: true,
   }, {
     input: "a?.com",
     fixedURI: "http://a/?.com",
     alternateURI: "http://www.a.com/?.com",
     protocolChange: true,
   }, {
     input: "?'.com",
+    fixedURI: "http:///?%27.com",
+    alternateURI: "http://www..com/?%27.com",
     keywordLookup: true,
     protocolChange: true,
   }, {
     input: "' ?.com",
     keywordLookup: true,
     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,
   }, {
     input: "mozilla/",
     fixedURI: "http://mozilla/",
     alternateURI: "http://www.mozilla.com/",
     protocolChange: true,
   }, {
--- a/dom/html/test/test_bug558788-1.html
+++ b/dom/html/test/test_bug558788-1.html
@@ -149,24 +149,23 @@ function checkInputURL()
   element.focus();
 
   synthesizeKey("h", {});
   checkInvalidApplies(element);
 
   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", {});
   }
   checkValidApplies(element);
 
   gContent.removeChild(element);
 }
 
--- a/dom/url/tests/test_url.html
+++ b/dom/url/tests/test_url.html
@@ -382,22 +382,10 @@
     is(url.href, "ftp://tmp/test");
 
     url = new URL("ftp:\\\\tmp\\test", base);
     is(url.href, "ftp://tmp/test");
 
     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>
--- a/extensions/cookie/test/unit/test_bug526789.js
+++ b/extensions/cookie/test/unit/test_bug526789.js
@@ -74,20 +74,33 @@ function run_test() {
     cm.countCookiesFromHost(".co.uk");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
   do_check_throws(function() {
     cm.countCookiesFromHost(".co.uk.");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
 
   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() {
     cm.countCookiesFromHost(".");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
   do_check_throws(function() {
     cm.countCookiesFromHost("..");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
--- a/services/fxaccounts/tests/xpcshell/test_oauth_grant_client.js
+++ b/services/fxaccounts/tests/xpcshell/test_oauth_grant_client.js
@@ -138,17 +138,17 @@ add_test(function serverErrorResponse ()
       do_check_eq(e.message, "Unauthorized");
       run_next_test();
     }
   );
 });
 
 add_test(function networkErrorResponse () {
   let client = new FxAccountsOAuthGrantClient({
-    serverURL: "http://domain.dummy",
+    serverURL: "http://",
     client_id: "abc123"
   });
   Services.prefs.setBoolPref("identity.fxaccounts.skipDeviceRegistration", true);
   client.getTokenFromAssertion("assertion", "scope")
     .then(
       null,
       function (e) {
         do_check_eq(e.name, "FxAccountsOAuthGrantClientError");
--- a/services/fxaccounts/tests/xpcshell/test_profile_client.js
+++ b/services/fxaccounts/tests/xpcshell/test_profile_client.js
@@ -263,17 +263,17 @@ add_test(function server401ResponsePersi
       do_check_eq(numTokensRemoved, 2);
       run_next_test();
     }
   );
 });
 
 add_test(function networkErrorResponse () {
   let client = new FxAccountsProfileClient({
-    serverURL: "http://domain.dummy",
+    serverURL: "http://",
     fxa: mockFxa,
   });
   client.fetchProfile()
     .then(
       null,
       function (e) {
         do_check_eq(e.name, "FxAccountsProfileClientError");
         do_check_eq(e.code, null);
--- a/testing/web-platform/meta/XMLHttpRequest/open-url-bogus.htm.ini
+++ b/testing/web-platform/meta/XMLHttpRequest/open-url-bogus.htm.ini
@@ -1,5 +1,13 @@
 [open-url-bogus.htm]
   type: testharness
   [XMLHttpRequest: open() - bogus URLs (http://u:p@/)]
     expected: FAIL
+  [XMLHttpRequest: open() - bogus URLs (http:)]
+    expected: FAIL
 
+  [XMLHttpRequest: open() - bogus URLs (ftp:)]
+    expected: FAIL
+
+  [XMLHttpRequest: open() - bogus URLs (http:////////////)]
+    expected: FAIL
+
--- a/testing/web-platform/meta/url/url-constructor.html.ini
+++ b/testing/web-platform/meta/url/url-constructor.html.ini
@@ -282,8 +282,11 @@
   [Parsing: <http://www/foo%2Ehtml> against <about:blank>]
     expected: FAIL
 
   [Parsing: <http://example.com/foo/%2e%2> against <about:blank>]
     expected: FAIL
 
   [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
\ No newline at end of file
--- a/toolkit/components/places/tests/unifiedcomplete/test_avoid_middle_complete.js
+++ b/toolkit/components/places/tests/unifiedcomplete/test_avoid_middle_complete.js
@@ -102,20 +102,16 @@ add_task(function* test_searchEngine_www
     autofilled: "www.ham",
     completed: "www.ham"
   });
 
   yield cleanup();
 });
 
 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/");
   let engine = Services.search.getEngineByName("PieSearch");
   engine.addParam("q", "{searchTerms}", null);
   do_register_cleanup(() => Services.search.removeEngine(engine));
 
   do_print("Should not autoFill search engine if search string has a different scheme.");