Bug 1735368 - fix browser_auto_close_window.js so it passes with download improvements enabled and when asking for all downloads, r=sfoster

Differential Revision: https://phabricator.services.mozilla.com/D128628
This commit is contained in:
Gijs Kruitbosch 2021-10-17 21:31:20 +00:00
Родитель 4d70548526
Коммит 0931eaffcf
1 изменённых файлов: 17 добавлений и 0 удалений

Просмотреть файл

@ -53,6 +53,23 @@ add_task(async function setup() {
HELPERAPP_DIALOG_CONTRACT_ID,
mockHelperAppService
);
// Ensure we always prompt for these downloads.
const HandlerService = Cc[
"@mozilla.org/uriloader/handler-service;1"
].getService(Ci.nsIHandlerService);
const MIMEService = Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService);
const mimeInfo = MIMEService.getFromTypeAndExtension(
"application/octet-stream",
"bin"
);
mimeInfo.alwaysAskBeforeHandling = true;
HandlerService.store(mimeInfo);
SimpleTest.registerCleanupFunction(() => {
HandlerService.remove(mimeInfo);
});
});
add_task(async function simple_navigation() {