| <script src="../resources/js-test.js"></script> |
| <script src="resources/audio-testing.js"></script> |
| <script src="resources/audiobuffersource-testing.js"></script> |
| var sampleRate = 44100.0; |
| context = new webkitOfflineAudioContext(1, numberOfFrames, sampleRate); |
| var source = context.createBufferSource(); |
| source.buffer = createTestBuffer(context, numberOfFrames); |
| source.connect(context.destination); |
| source.onended = function() |
| testPassed("source.onended called."); |
| context.startRendering(); |
| // trigger a GC in the next micro task to try and collect source. |
| Promise.resolve().then(gc); |
| <body onload="runTest()"> |
| <div>Tests that AudioBufferSourceNode calls its onended EventListener, even after a GC.</div> |