Add waitForDialog(onOpen, button) support function

Waits for an alert or confirmation dialog to open and closes it
automatically, optionally after running onOpen(dialog) to check its
contents (e.g., with dialog.document.documentElement.textContent) and
optionally clicking a button other than 'accept' (e.g., 'cancel',
extra1').

Supports delayed accept buttons
This commit is contained in:
Dan Stillman 2015-06-04 18:52:47 -04:00
parent 582799e428
commit da627e137a
2 changed files with 64 additions and 5 deletions

View file

@ -7,10 +7,7 @@ describe("Search Preferences", function () {
action: 'pdftools-install'
});
// Wait for confirmation dialog
yield waitForWindow("chrome://global/content/commonDialog.xul", function (dialog) {
// Accept confirmation dialog
dialog.document.documentElement.acceptDialog();
});
yield waitForDialog();
// Wait for install to finish
yield waitForCallback(function() {