| Basic tests for AudioNode API. |
| |
| On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". |
| |
| PASS context.state is "suspended" |
| node.connect(context.destination) |
| EVENT statechange |
| PASS context.state is "running" |
| |
| Test 1: resume() while interrupted is resolved after the interruption ends. |
| internals.beginMediaSessionInterruption("System") |
| EVENT statechange |
| PASS context.state is "interrupted" |
| internals.setMediaSessionRestrictions("WebAudio", "InterruptedPlaybackNotPermitted") |
| Calling context.resume() |
| Delaying 100ms |
| PASS context.state is "interrupted" |
| internals.endMediaSessionInterruption("MayResumePlaying") |
| PASS context.resume() promise resolved |
| PASS context.state is "running" |
| |
| Test 2: resume() while interrupted will cause interruption to end. |
| internals.beginMediaSessionInterruption("System") |
| EVENT statechange |
| PASS context.state is "interrupted" |
| internals.setMediaSessionRestrictions("WebAudio", "") |
| Calling context.resume() |
| PASS context.resume() promise resolved |
| PASS context.state is "running" |
| |
| Test 3: running AudioContexts will not resume after an interruption ends. |
| internals.beginMediaSessionInterruption("System") |
| EVENT statechange |
| PASS context.state is "interrupted" |
| internals.endMediaSessionInterruption("") |
| EVENT statechange |
| PASS context.state is "suspended" |
| |
| Test 4: resume() while interrupted will not resume playback after an interruption. |
| internals.setMediaSessionRestrictions("WebAudio", "InterruptedPlaybackNotPermitted") |
| internals.beginMediaSessionInterruption("System") |
| EVENT statechange |
| PASS context.state is "interrupted" |
| Calling context.resume() |
| internals.endMediaSessionInterruption("") |
| EVENT statechange |
| PASS context.state is "suspended" |
| PASS successfullyParsed is true |
| |
| TEST COMPLETE |
| |