Bug 1767549 - Fix test_currentTime.html to wait for the initial "suspended" -> "running" transition. r=karlt

Differential Revision: https://phabricator.services.mozilla.com/D147086
This commit is contained in:
Paul Adenot 2022-05-24 08:52:12 +00:00
Родитель 6a1523cfa1
Коммит 5f88cd32c1
1 изменённых файлов: 3 добавлений и 2 удалений

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

@ -14,10 +14,11 @@ SimpleTest.requestFlakyTimeout("This test needs to wait a while for the AudioCon
addLoadEvent(function() {
var ac = new AudioContext();
is(ac.currentTime, 0, "AudioContext.currentTime should be 0 initially");
setTimeout(function() {
ac.onstatechange = function () {
ok(ac.state == "running", "AudioContext.currentTime should eventually start");
ok(ac.currentTime > 0, "AudioContext.currentTime should have increased by now");
SimpleTest.finish();
}, 1000);
}
});
</script>