mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1805806 - Nullify the onchange listeners before the end of the test to avoid intermittent failures. r=rpl,bholley
Differential Revision: https://phabricator.services.mozilla.com/D167272
This commit is contained in:
parent
d42dc60869
commit
f911a1db2e
@ -54,6 +54,7 @@
|
||||
// We expect the same states with and without sysex support.
|
||||
const expectedChangedStates = ["denied", "granted", "prompt"];
|
||||
|
||||
const results = [];
|
||||
for (let sysex of [false, true]) {
|
||||
let result = await navigator.permissions.query({ name: "midi", sysex });
|
||||
is(result?.state, "prompt", "expected 'prompt' permission status");
|
||||
@ -68,6 +69,7 @@
|
||||
"expected change event with sysex support"
|
||||
);
|
||||
};
|
||||
results.push(result);
|
||||
} else {
|
||||
result.onchange = () => {
|
||||
is(
|
||||
@ -76,6 +78,7 @@
|
||||
"expected change event"
|
||||
);
|
||||
};
|
||||
results.push(result);
|
||||
}
|
||||
}
|
||||
|
||||
@ -169,6 +172,8 @@
|
||||
await SpecialPowers.removePermission("midi-sysex", document);
|
||||
await SpecialPowers.removePermission("midi", document);
|
||||
|
||||
results.forEach(result => result.onchange = null);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user