Skip to content

Commit

Permalink
Bug 1731710 - ensure main window is focused before starting a downloa…
Browse files Browse the repository at this point in the history
…d in browser_test_data_download.js and browser_test_data_text_csv.js, r=aryx

Differential Revision: https://phabricator.services.mozilla.com/D137035
  • Loading branch information
gijsk committed Jan 26, 2022
1 parent fe88e4a commit 6827df6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion dom/security/test/general/browser_test_data_download.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ add_task(async function test_with_downloads_pref_disabled() {
"file name of download should match"
);

win.close();
let mainWindowActivated = BrowserTestUtils.waitForEvent(window, "activate");
await BrowserTestUtils.closeWindow(win);
await mainWindowActivated;
});

add_task(async function test_with_downloads_pref_enabled() {
Expand Down
4 changes: 3 additions & 1 deletion dom/security/test/general/browser_test_data_text_csv.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ add_task(async function test_with_downloads_improvement_pref_disabled() {
expectedValue,
"file name of download should match"
);
win.close();
let mainWindowActivated = BrowserTestUtils.waitForEvent(window, "activate");
await BrowserTestUtils.closeWindow(win);
await mainWindowActivated;
});

add_task(async function test_with_downloads_improvement_pref_enabled() {
Expand Down

0 comments on commit 6827df6

Please sign in to comment.