audionode-iframe.window.js (560B)
1 test(function() { 2 const iframe = 3 document.createElementNS('http://www.w3.org/1999/xhtml', 'iframe'); 4 document.body.appendChild(iframe); 5 6 // Create AudioContext and AudioNode from iframe 7 const context = new iframe.contentWindow.AudioContext(); 8 const source = context.createOscillator(); 9 source.connect(context.destination); 10 11 // AudioContext should be put closed state after iframe destroyed 12 document.body.removeChild(iframe); 13 assert_equals(context.state, 'closed'); 14 }, 'Call a constructor from iframe page and then destroy the iframe');