Backed out 4 changesets (bug 1517025) for multiple failures e.g.: toolkit/components/telemetry/tests/unit/test_PingAPI.js CLOSED TREE
authorMargareta Eliza Balazs <ebalazs@mozilla.com>
Mon, 21 Jan 2019 16:13:56 +0200
changeset 454670 22471aa9be27f7897495d4bb4b2d6fd1900e620b
parent 454669 053747e3a369cc4ec41ec4e6b2620489e655ca61
child 454671 46a48161f4282af4708ddd3b2eed6943da864add
push id35409
push userrmaries@mozilla.com
push dateMon, 21 Jan 2019 17:48:45 +0000
treeherdermozilla-central@4977d02e1191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1517025
milestone66.0a1
backs out1e173178e49f41ecb99f5179308c0591b960ef6f
c29889dea969f8ccbce2f5a2a479f6468510e6a6
48c7d643d2fa9caf7ebe07831cb5d15fa7f82a76
419cb778d5316033fc772898d2160e9998c6ee14
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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)
dom/base/crashtests/1517025.html
dom/base/crashtests/crashtests.list
netwerk/base/nsStandardURL.cpp
netwerk/test/unit/test_bug412457.js
netwerk/test/unit/test_bug464591.js
netwerk/test/unit/test_standardurl.js
testing/profiles/xpcshell/user.js
testing/web-platform/meta/url/url-constructor.html.ini
deleted file mode 100644
--- a/dom/base/crashtests/1517025.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-  <body>
-    <iframe src="/\b%9ª">
-  </body>
-</html>
--- a/dom/base/crashtests/crashtests.list
+++ b/dom/base/crashtests/crashtests.list
@@ -244,9 +244,8 @@ load 1462548.html
 load 1505811.html
 load 1505875.html
 load 1508845.html
 load 1516289.html
 load 1516560.html
 load structured_clone_container_throws.html
 load xhr_empty_datauri.html
 load xhr_html_nullresponse.html
-load 1517025.html
--- a/netwerk/base/nsStandardURL.cpp
+++ b/netwerk/base/nsStandardURL.cpp
@@ -55,26 +55,30 @@ nsIIDNService *nsStandardURL::gIDN = nul
 // may race when reading this values, but that's OK because in the worst
 // case we will just dispatch a noop runnable to the main thread.
 bool nsStandardURL::gInitialized = false;
 
 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.
 //
 constexpr bool TestForInvalidHostCharacters(char c) {
   // Testing for these:
   // CONTROL_CHARACTERS " #/:?@[\\]*<>|\"";
   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);
 
 //----------------------------------------------------------------------------
 // nsStandardURL::nsSegmentEncoder
 //----------------------------------------------------------------------------
 
--- a/netwerk/test/unit/test_bug412457.js
+++ b/netwerk/test/unit/test_bug412457.js
@@ -24,22 +24,22 @@ function run_test() {
   Assert.equal(newURI.asciiHost, "example.com");
 
   newURI = newURI.mutate().setSpec("http://example.com:80").finalize();
   Assert.equal(newURI.asciiHost, "example.com");
 
   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");
 }
--- a/netwerk/test/unit/test_bug464591.js
+++ b/netwerk/test/unit/test_bug464591.js
@@ -1,22 +1,20 @@
  // 1.percent-encoded IDN that contains blacklisted character should be converted
  //   to punycode, not UTF-8 string
  // 2.only hostname-valid percent encoded ASCII characters should be decoded
  // 3.IDN convertion must not bypassed by %00
 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 =
   [
     {
       name: "network.enableIDN",
       newVal: true
     },
     {
       name: "network.IDN_show_punycode",
@@ -72,14 +70,9 @@ function run_test() {
   for (let i = 0; i < reference.length; ++i) {
     try {
       let result = stringToURL("http://" + reference[i][0]).host;
       equal(result, reference[i][1]);
     } catch (e) {
       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");
-  }
 }
--- a/netwerk/test/unit/test_standardurl.js
+++ b/netwerk/test/unit/test_standardurl.js
@@ -1,11 +1,10 @@
 "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)
 {
   /* Use if/else instead of |do_check_eq(expect, a.spec == b.spec)| so
      that we get the specs output on the console if the check fails.
    */
   if (expect) {
@@ -308,19 +307,19 @@ add_test(function test_accentEncoding()
   run_next_test();
 });
 
 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();
 });
 
 add_test(function test_hugeStringThrows()
 {
   let prefs = Cc["@mozilla.org/preferences-service;1"]
                 .getService(Ci.nsIPrefService);
   let maxLen = prefs.getIntPref("network.standard-url.max-length");
@@ -692,22 +691,8 @@ add_test(function test_idna_host() {
   equal(url.asciiSpec, "http://user:password@xn--lt-uia.example.org:8080/path?query");
 
   url = stringToURL("http://user:password@www.ält.com:8080/path?query#etc");
   url = url.mutate().setRef("").finalize();
   equal(url.spec, "http://user:password@www.xn--lt-uia.com:8080/path?query");
 
   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();
-});
--- a/testing/profiles/xpcshell/user.js
+++ b/testing/profiles/xpcshell/user.js
@@ -1,18 +1,18 @@
 // 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
 // disable the process priority manager entirely here.
 user_pref("dom.ipc.processPriorityManager.enabled", false);
--- a/testing/web-platform/meta/url/url-constructor.html.ini
+++ b/testing/web-platform/meta/url/url-constructor.html.ini
@@ -84,19 +84,43 @@
     expected: FAIL
 
   [Parsing: <http://﷐zyx.com> against <http://other.com/>]
     expected: FAIL
 
   [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
 
   [Parsing: <i> against <sc://ho/pa>]
     expected: FAIL
 
   [Parsing: <i> against <sc:///pa/pa>]
     expected: FAIL
@@ -418,19 +442,25 @@
     expected: FAIL
 
   [Parsing: <sc://ñ.test/> against <about:blank>]
     expected: FAIL
 
   [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
 
   [Parsing: <https://�> against <about:blank>]
     expected: FAIL
 
   [Parsing: <data:test# »> against <about:blank>]
     expected: FAIL