diff --git a/toolkit/components/jsdownloads/test/unit/head.js b/toolkit/components/jsdownloads/test/unit/head.js index 5490fd9a5f1c..70d34f1e2a7a 100644 --- a/toolkit/components/jsdownloads/test/unit/head.js +++ b/toolkit/components/jsdownloads/test/unit/head.js @@ -137,15 +137,8 @@ function getTempFile(aLeafName) do_check_false(file.exists()); do_register_cleanup(function () { - try { + if (file.exists()) { file.remove(false); - } catch (ex if (ex instanceof Components.Exception && - (ex.result == Cr.NS_ERROR_FILE_ACCESS_DENIED || - ex.result == Cr.NS_ERROR_FILE_TARGET_DOES_NOT_EXIST))) { - // On Windows, we may get an access denied error if the file existed before, - // and was recently deleted. - // Don't bother checking file.exists() as that may also cause an access - // denied error. } });