Bug 1712898 test that escaping selectAudioOutput prompt does not block future prompts r=jib,pbz

Differential Revision: https://phabricator.services.mozilla.com/D116795
This commit is contained in:
Karl Tomlinson 2021-06-09 04:01:39 +00:00
Родитель 2c764178d7
Коммит 8e4152d193
1 изменённых файлов: 18 добавлений и 0 удалений

Просмотреть файл

@ -40,6 +40,14 @@ async function deny() {
await observerPromise;
}
async function escape() {
const observerPromise = expectObserverCalled("getUserMedia:response:deny");
await promiseMessage(permissionError, () => {
EventUtils.synthesizeKey("KEY_Escape");
});
await observerPromise;
}
var gTests = [
{
desc: 'User clicks "Allow"',
@ -58,6 +66,16 @@ var gTests = [
await deny();
},
},
{
desc: 'User presses "Esc"',
run: async function checkBlock() {
await requestAudioOutputExpectingPrompt();
await escape();
info("selectAudioOutput() after Esc should prompt again.");
await requestAudioOutputExpectingPrompt();
await allow();
},
},
];
add_task(async function test() {