Skip to content

Commit

Permalink
Bug 1895738 - [remote] Fix fromJSON checks for ignore behavior in tes…
Browse files Browse the repository at this point in the history
…t_UserPromptHandler.js. CLOSED TREE

Differential Revision: https://phabricator.services.mozilla.com/D211173
  • Loading branch information
whimboo committed May 22, 2024
1 parent cb4d6ef commit 929e1d7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions remote/shared/webdriver/test/xpcshell/test_UserPromptHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ add_task(function test_UserPromptHandler_fromJSON() {
ok(promptHandler.activePromptHandlers.has("default"));
const handler = promptHandler.activePromptHandlers.get("default");
ok(behavior.startsWith(handler.handler));
equal(handler.notify, /and notify/.test(behavior));
if (behavior == "ignore") {
ok(handler.notify);
} else {
equal(handler.notify, /and notify/.test(behavior));
}
}

// Unhandled prompt behavior as object
Expand All @@ -77,7 +81,11 @@ add_task(function test_UserPromptHandler_fromJSON() {
ok(promptHandler.activePromptHandlers.has(promptType));
const handler = promptHandler.activePromptHandlers.get(promptType);
ok(behavior.startsWith(handler.handler));
equal(handler.notify, /and notify/.test(behavior));
if (behavior == "ignore") {
ok(handler.notify);
} else {
equal(handler.notify, /and notify/.test(behavior));
}
}
}
});
Expand Down

0 comments on commit 929e1d7

Please sign in to comment.