Bug 1747561 - fix intermittents in browser_open_internal_choice_persistence.js by enforcing which window is active, r=jaws

Differential Revision: https://phabricator.services.mozilla.com/D139325
This commit is contained in:
Gijs Kruitbosch 2022-02-22 16:11:47 +00:00
Родитель 72a1b5cd91
Коммит 42b2e23515
1 изменённых файлов: 9 добавлений и 0 удалений

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

@ -187,6 +187,10 @@ add_task(async function test_check_saving_handler_choices() {
let doc = dialogWindow.document;
let internalHandlerRadio = doc.querySelector("#handleInternally");
if (Services.focus.activeWindow != dialogWindow) {
await BrowserTestUtils.waitForEvent(dialogWindow, "activate");
}
await waitForAcceptButtonToGetEnabled(doc);
ok(!internalHandlerRadio.hidden, "The option should be visible for SVG");
@ -221,8 +225,13 @@ add_task(async function test_check_saving_handler_choices() {
await testCase.dialogActions(doc);
let mainWindowActivatedAndFocused = Promise.all([
BrowserTestUtils.waitForEvent(window, "activate"),
BrowserTestUtils.waitForEvent(window, "focus", true),
]);
let dialog = doc.querySelector("#unknownContentType");
dialog.acceptDialog();
await mainWindowActivatedAndFocused;
let download = await downloadFinishedPromise;
if (expectLaunch) {