commit 79f0e4761f1251046949efb5086aeeb0ec57cb66 parent 2f7d2c09f01c65e6011b4b9af08bc212aa7502c6 Author: Dan Stillman <dstillman@zotero.org> Date: Wed, 10 Jun 2015 00:32:42 -0400 Handle delays for all non-cancel buttons in waitForDialog() in tests When the button delay is enabled, all buttons other than Cancel are delayed. Diffstat:
| M | test/content/support.js | | | 8 | ++++---- |
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/test/content/support.js b/test/content/support.js @@ -120,17 +120,17 @@ function waitForDialog(onOpen, button='accept') { failure = e; } } - if (button == 'accept') { + if (button != 'cancel') { let deferred = Zotero.Promise.defer(); function acceptWhenEnabled() { - // Handle delayed accept buttons - if (dialog.document.documentElement.getButton('accept').disabled) { + // Handle delayed buttons + if (dialog.document.documentElement.getButton(button).disabled) { setTimeout(function () { acceptWhenEnabled(); }, 250); } else { - dialog.document.documentElement.acceptDialog(); + dialog.document.documentElement.getButton(button).click(); if (failure) { deferred.reject(failure); }