Backed out changeset 0d3748a0ad24 (bug 1420744) for c4 failures in toolkit/components/extensions/test/mochitest/test_chrome_ext_downloads_saveAs.htm
authorshindli <shindli@mozilla.com>
Tue, 02 Oct 2018 04:18:05 +0300
changeset 494813 2c0daf489bc94c5cfb0e64cbaa193c110ae67289
parent 494812 b05bfd129c6b097b772d1c2db27434631d475f6d
child 494814 08125cd5d357b9da68af7a4b22122f07fc35243c
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1420744
milestone64.0a1
backs out0d3748a0ad24606a4debc37726b0743ab4676734
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 0d3748a0ad24 (bug 1420744) for c4 failures in toolkit/components/extensions/test/mochitest/test_chrome_ext_downloads_saveAs.htm
mobile/android/components/extensions/test/mochitest/mochitest.ini
mobile/android/components/extensions/test/mochitest/test_ext_downloads_saveAs.html
toolkit/components/extensions/parent/ext-downloads.js
--- a/mobile/android/components/extensions/test/mochitest/mochitest.ini
+++ b/mobile/android/components/extensions/test/mochitest/mochitest.ini
@@ -9,17 +9,16 @@ support-files =
   file_bypass_cache.sjs
   file_dummy.html
   file_iframe_document.html
   file_slowed_document.sjs
   head.js
 tags = webextensions
 
 [test_ext_all_apis.html]
-[test_ext_downloads_saveAs.html]
 [test_ext_tab_runtimeConnect.html]
 [test_ext_tabs_captureVisibleTab.html]
 [test_ext_tabs_create.html]
 [test_ext_tabs_events.html]
 [test_ext_tabs_executeScript.html]
 [test_ext_tabs_executeScript_bad.html]
 skip-if = true # Currently fails in emulator runs
 [test_ext_tabs_executeScript_good.html]
deleted file mode 100644
--- a/mobile/android/components/extensions/test/mochitest/test_ext_downloads_saveAs.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Downloads Test</title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/AddTask.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
-  <script type="text/javascript" src="head.js"></script>
-  <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-// saveAs is not implemented on Fennec but this tests that a call to download() that supplies that option passes anyway.
-add_task(async function testDownload() {
-  let extension = ExtensionTestUtils.loadExtension({
-    manifest: {permissions: ["downloads"]},
-
-    background: async function() {
-      const url = URL.createObjectURL(new Blob(["file content"]));
-      const id = await browser.downloads.download({
-        url,
-        saveAs: true,
-      });
-
-      browser.downloads.onChanged.addListener(delta => {
-        if (delta.id == id && delta.state.current === "complete") {
-          browser.test.notifyPass("downloadPass");
-        }
-      });
-    },
-  });
-
-  await extension.startup();
-
-  await extension.awaitFinish("downloadPass");
-
-  await extension.unload();
-});
-</script>
-
-</body>
-</html>
--- a/toolkit/components/extensions/parent/ext-downloads.js
+++ b/toolkit/components/extensions/parent/ext-downloads.js
@@ -506,17 +506,17 @@ this.downloads = class extends Extension
                   }
                   break;
 
                 case "overwrite":
                   break;
               }
             }
 
-            if (!saveAs || AppConstants.platform === "android") {
+            if (!saveAs) {
               return target;
             }
 
             const window = Services.wm.getMostRecentWindow("navigator:browser");
             const basename = OS.Path.basename(target);
             const ext = basename.match(/\.([^.]+)$/);
 
             // Setup the file picker Save As dialog.