Bug 1349255 - Part 2: Wait for DOMModalDialogClosed after clicked cancel button. r?MattN
MozReview-Commit-ID: ARwVCZTdSSI
--- a/toolkit/components/passwordmgr/test/browser/browser_master_password_autocomplete.js
+++ b/toolkit/components/passwordmgr/test/browser/browser_master_password_autocomplete.js
@@ -5,16 +5,17 @@ const TIMEOUT_PREF = "signon.masterPassw
// Waits for the master password prompt and cancels it.
function waitForDialog() {
let dialogShown = TestUtils.topicObserved("common-dialog-loaded");
return dialogShown.then(function([subject]) {
let dialog = subject.Dialog;
is(dialog.args.title, "Password Required");
dialog.ui.button1.click();
+ return BrowserTestUtils.waitForEvent(window, "DOMModalDialogClosed");
});
}
// Test that autocomplete does not trigger a master password prompt
// for a certain time after it was cancelled.
add_task(async function test_mpAutocompleteTimeout() {
let login = LoginTestUtils.testData.formLogin({
hostname: "https://example.com",