Bug 1257581 Fix and re-enable downloads misc tests r?kmag draft
authorAndrew Swan <aswan@mozilla.com>
Fri, 25 Mar 2016 14:34:56 -0700
changeset 345303 870e3d3e62e6a2440e37ddcdc0e16d7b86d12261
parent 344815 2bac6e929e8f4edcef0a17cbe8c38d29381e0207
child 517149 bbb59ba473b57a40c50137ce5ee43d1e81dfb458
push id14040
push useraswan@mozilla.com
push dateMon, 28 Mar 2016 19:25:07 +0000
reviewerskmag
bugs1257581
milestone48.0a1
Bug 1257581 Fix and re-enable downloads misc tests r?kmag The original problem was that the erase() test did not wait for downloads to complete which caused a race with cleanup code trying to remove the download directory while downloads were still writing to it. This was fixed in https://hg.mozilla.org/mozilla-central/rev/d6d9e7411319 But meanwhile, the removeFile() test bit-rotted slightly, fixed it here and re-enabled the misc test. MozReview-Commit-ID: 6BgDKKkUK55
toolkit/components/extensions/test/mochitest/chrome.ini
toolkit/components/extensions/test/mochitest/test_chrome_ext_downloads_misc.html
--- a/toolkit/components/extensions/test/mochitest/chrome.ini
+++ b/toolkit/components/extensions/test/mochitest/chrome.ini
@@ -3,12 +3,11 @@ skip-if = os == 'android'
 support-files =
   file_download.html
   file_download.txt
   interruptible.sjs
   file_sample.html
 
 [test_chrome_ext_downloads_download.html]
 [test_chrome_ext_downloads_misc.html]
-skip-if = 1 # Currently causes too many intermittent failures.
 [test_chrome_ext_downloads_search.html]
 [test_chrome_ext_eventpage_warning.html]
 [test_chrome_ext_contentscript_unrecognizedprop_warning.html]
--- a/toolkit/components/extensions/test/mochitest/test_chrome_ext_downloads_misc.html
+++ b/toolkit/components/extensions/test/mochitest/test_chrome_ext_downloads_misc.html
@@ -602,16 +602,25 @@ add_task(function* test_removal_of_incom
           previous: false,
           current: true,
         },
         canResume: {
           previous: false,
           current: true,
         },
       },
+    }, {
+      type: "onChanged",
+      data: {
+        id,
+        error: {
+          previous: null,
+          current: "USER_CANCELED",
+        },
+      },
     }]);
   is(msg.status, "success", "got onChanged event corresponding to pause");
 
   msg = yield runInExtension("removeFile", id);
   is(msg.status, "error", "removeFile() on paused download failed");
 
   ok(/Cannot remove incomplete download/.test(msg.errmsg), "removeFile() failed due to download being incomplete");