RESOLVED FIXED 216331
Port BaseAudioContext to the HTML event loop
https://bugs.webkit.org/show_bug.cgi?id=216331
Summary Port BaseAudioContext to the HTML event loop
Chris Dumez
Reported 2020-09-09 15:40:18 PDT
Port BaseAudioContext to the HTML event loop.
Attachments
Patch (4.13 KB, patch)
2020-09-09 15:41 PDT, Chris Dumez
no flags
Patch (4.41 KB, patch)
2020-09-09 17:51 PDT, Chris Dumez
no flags
Patch (4.51 KB, patch)
2020-09-09 18:43 PDT, Chris Dumez
no flags
Patch (5.27 KB, patch)
2020-09-09 18:46 PDT, Chris Dumez
no flags
Patch (9.87 KB, patch)
2020-09-10 08:49 PDT, Chris Dumez
no flags
Patch (8.49 KB, patch)
2020-09-10 09:24 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2020-09-09 15:41:34 PDT
Chris Dumez
Comment 2 2020-09-09 17:51:27 PDT
Chris Dumez
Comment 3 2020-09-09 18:43:26 PDT
Chris Dumez
Comment 4 2020-09-09 18:46:13 PDT
Chris Dumez
Comment 5 2020-09-10 08:49:37 PDT
Eric Carlson
Comment 6 2020-09-10 09:16:35 PDT
Comment on attachment 408449 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=408449&action=review > LayoutTests/webaudio/audiocontext-state-interrupted.html:74 > + setTimeout(function() { > + debug(''); > + debug('Test 2: resume() while interrupted will cause interruption to end.') > > - context.onstatechange = secondInterruptionStarted; > - if (window.internals) > - evalAndLog('internals.beginMediaSessionInterruption("System")'); > + context.onstatechange = secondInterruptionStarted; > + if (window.internals) > + evalAndLog('internals.beginMediaSessionInterruption("System")'); > + }, 0); It would be good to have a LayoutTests ChangeLog explaining why these changes are necessary.
Chris Dumez
Comment 7 2020-09-10 09:19:22 PDT
(In reply to Eric Carlson from comment #6) > Comment on attachment 408449 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=408449&action=review > > > LayoutTests/webaudio/audiocontext-state-interrupted.html:74 > > + setTimeout(function() { > > + debug(''); > > + debug('Test 2: resume() while interrupted will cause interruption to end.') > > > > - context.onstatechange = secondInterruptionStarted; > > - if (window.internals) > > - evalAndLog('internals.beginMediaSessionInterruption("System")'); > > + context.onstatechange = secondInterruptionStarted; > > + if (window.internals) > > + evalAndLog('internals.beginMediaSessionInterruption("System")'); > > + }, 0); > > It would be good to have a LayoutTests ChangeLog explaining why these > changes are necessary. Yes. Basically the issue is we sometimes move to on test to another based a Promise resolution (e.g. context.resume() / context.suspend() return promises). The promise gets resolved *BEFORE* the statechange event gets fired, as per spec. The setTimeout(0) makes sure any pending statechange event has been fired before we move on to the next text (because the next test may rely on the statechange event and we don't want it to receive the event from the previous test).
Chris Dumez
Comment 8 2020-09-10 09:24:07 PDT
EWS
Comment 9 2020-09-10 10:32:46 PDT
Committed r266835: <https://trac.webkit.org/changeset/266835> All reviewed patches have been landed. Closing bug and clearing flags on attachment 408450 [details].
Radar WebKit Bug Importer
Comment 10 2020-09-10 10:33:16 PDT
Note You need to log in before you can comment on or make changes to this bug.