closed-audiocontext-construction.html (877B)
1 <!doctype html> 2 <title>MediaStreamAudioDestinationNode after closing AudioContext</title> 3 <meta charset="utf-8"> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <script> 7 promise_test(async t => { 8 const context = new AudioContext(); 9 await context.close(); 10 assert_equals(context.state, "closed", "The AudioContext should report a closed state"); 11 12 let audioNode; 13 try { 14 audioNode = new MediaStreamAudioDestinationNode(context); 15 } catch (err) { 16 assert_unreached(`Constructing MediaStreamAudioDestinationNode should not throw when the context is closed. Threw: ${err}`); 17 } 18 19 assert_true(audioNode instanceof MediaStreamAudioDestinationNode, "The created node should be a MediaStreamAudioDestinationNode"); 20 }, "Constructing MediaStreamAudioDestinationNode on a closed AudioContext succeeds"); 21 </script>