Backed out changeset c9206e361572 (bug 1562176) for failures on test_DownloadPaths.js. CLOSED TREE
authorCsoregi Natalia <ncsoregi@mozilla.com>
Tue, 09 Jul 2019 19:28:51 +0300
changeset 542416 c58773dc939aab5b059fd3335b1d2513edc8224a
parent 542415 6b270cebf3c19510e233bf380652fd982f3a6fa5
child 542417 f77ccfcb52339b0aa7cb82debd2f88fbc7dcf596
push id11848
push userffxbld-merge
push dateMon, 26 Aug 2019 19:26:25 +0000
treeherdermozilla-beta@9b31bfdfac10 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1562176
milestone70.0a1
backs outc9206e361572d5b404fc34590793f87ee4592703
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 changeset c9206e361572 (bug 1562176) for failures on test_DownloadPaths.js. CLOSED TREE
toolkit/components/downloads/DownloadPaths.jsm
toolkit/components/downloads/test/unit/test_DownloadPaths.js
--- a/toolkit/components/downloads/DownloadPaths.jsm
+++ b/toolkit/components/downloads/DownloadPaths.jsm
@@ -19,28 +19,28 @@ ChromeUtils.defineModuleGetter(
   "AppConstants",
   "resource://gre/modules/AppConstants.jsm"
 );
 
 /**
  * Platform-dependent regular expression used by the "sanitize" method.
  */
 XPCOMUtils.defineLazyGetter(this, "gConvertToSpaceRegExp", () => {
-  // Note: we remove colons everywhere to avoid issues in subresource URL
-  // parsing, as well as filename restrictions on some OSes (see bug 1562176).
   /* eslint-disable no-control-regex */
   switch (AppConstants.platform) {
     // On mobile devices, the file system may be very limited in what it
     // considers valid characters. To avoid errors, sanitize conservatively.
     case "android":
       return /[\x00-\x1f\x7f-\x9f:*?|"<>;,+=\[\]]+/g;
     case "win":
       return /[\x00-\x1f\x7f-\x9f:*?|]+/g;
+    case "macosx":
+      return /[\x00-\x1f\x7f-\x9f:]+/g;
     default:
-      return /[\x00-\x1f\x7f-\x9f:]+/g;
+      return /[\x00-\x1f\x7f-\x9f]+/g;
   }
   /* eslint-enable no-control-regex */
 });
 
 var DownloadPaths = {
   /**
    * Sanitizes an arbitrary string for use as the local file name of a download.
    * The input is often a document title or a manually edited name. The output
--- a/toolkit/components/downloads/test/unit/test_DownloadPaths.js
+++ b/toolkit/components/downloads/test/unit/test_DownloadPaths.js
@@ -74,19 +74,16 @@ add_task(async function test_sanitize() 
   testSanitize(".", "");
   testSanitize("..", "");
   testSanitize(" ", "");
   testSanitize(" . ", "");
 
   // Stripping of BIDI formatting characters.
   testSanitize("\u200e \u202b\u202c\u202d\u202etest\x7f\u200f", "test");
   testSanitize("AB\x7f\u202a\x7f\u202a\x7fCD", "AB CD");
-
-  // Stripping of colons:
-  testSanitize("foo:bar", "foo bar");
 });
 
 add_task(async function test_splitBaseNameAndExtension() {
   // Usual file names.
   testSplitBaseNameAndExtension("base", ["base", ""]);
   testSplitBaseNameAndExtension("base.ext", ["base", ".ext"]);
   testSplitBaseNameAndExtension("base.application", ["base", ".application"]);
   testSplitBaseNameAndExtension("base.x.Z", ["base", ".x.Z"]);