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
--- 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");