зеркало из https://github.com/mozilla/gecko-dev.git
bug 1502268: marionette: provide informative messages for unexpected alert open error; r=whimboo
Provides specific error messages informing the user what action was taken with the user prompt, based on the configuration of the unhandled prompt handler. Differential Revision: https://phabricator.services.mozilla.com/D10089 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
343e0160ee
Коммит
07c0fa4fe6
|
@ -3229,6 +3229,8 @@ GeckoDriver.prototype._handleUserPrompts = async function() {
|
|||
return;
|
||||
}
|
||||
|
||||
let {textContent} = this.dialog.ui.infoBody;
|
||||
|
||||
let behavior = this.capabilities.get("unhandledPromptBehavior");
|
||||
switch (behavior) {
|
||||
case UnhandledPromptBehavior.Accept:
|
||||
|
@ -3237,7 +3239,8 @@ GeckoDriver.prototype._handleUserPrompts = async function() {
|
|||
|
||||
case UnhandledPromptBehavior.AcceptAndNotify:
|
||||
await this.acceptDialog();
|
||||
throw new UnexpectedAlertOpenError();
|
||||
throw new UnexpectedAlertOpenError(
|
||||
`Accepted user prompt dialog: ${textContent}`);
|
||||
|
||||
case UnhandledPromptBehavior.Dismiss:
|
||||
await this.dismissDialog();
|
||||
|
@ -3245,10 +3248,12 @@ GeckoDriver.prototype._handleUserPrompts = async function() {
|
|||
|
||||
case UnhandledPromptBehavior.DismissAndNotify:
|
||||
await this.dismissDialog();
|
||||
throw new UnexpectedAlertOpenError();
|
||||
throw new UnexpectedAlertOpenError(
|
||||
`Dismissed user prompt dialog: ${textContent}`);
|
||||
|
||||
case UnhandledPromptBehavior.Ignore:
|
||||
throw new UnexpectedAlertOpenError();
|
||||
throw new UnexpectedAlertOpenError(
|
||||
"Encountered unhandled user prompt dialog");
|
||||
|
||||
default:
|
||||
throw new TypeError(`Unknown unhandledPromptBehavior "${behavior}"`);
|
||||
|
|
Загрузка…
Ссылка в новой задаче