AccessCase should strongly visit its dependencies while on stack
[WebKit-https.git] / LayoutTests / webaudio / silence-after-playback.html
1 <!DOCTYPE html>
2 <html>
3     <head>
4         <script src="../resources/js-test.js"></script>
5         <script src="resources/audio-testing.js"></script>
6     </head>
7
8     <body>
9         <div id="description"></div>
10         <div id="console"></div>
11
12         <script>
13          description("Test ensuring silence is output after <audio> playback ended.");
14
15          let context = 0;
16          const sampleRate = 44100.0;
17          const lengthInSeconds = 3;
18
19          function ended() {
20              context.startRendering();
21              context.oncomplete = finishAudioTest;
22          }
23
24          function runTest() {
25              context = new webkitOfflineAudioContext(2, sampleRate * lengthInSeconds, sampleRate);
26
27              audioElement = new Audio();
28              audioElement.src = "resources/media/128kbps-44khz.mp3";
29              document.body.appendChild(audioElement);
30
31              mediaSource = context.createMediaElementSource(audioElement);
32              window.audioNode = mediaSource;
33
34              mediaSource.connect(context.destination);
35
36              audioElement.play();
37              audioElement.addEventListener("ended", ended, true);
38              testRunner.waitUntilDone();
39          }
40
41          runTest();
42         </script>
43     </body>
44 </html>