778c3fa6d6c5ba75ee901ab93bfb21b217c0c819
[WebKit-https.git] / LayoutTests / media / media-load-event.html
1 <html>
2     <head>
3         <script src=video-test.js></script>
4
5         <script>
6
7             function loaded()
8             {
9                 consoleWrite("EVENT(load)");
10                 consoleWrite("");
11                 run("document.getElementById('parent').appendChild(mediaElement)");
12                 run("mediaElement.play()");
13                 window.setTimeout(endTest, 250);
14                 consoleWrite("");
15             }
16
17             function start()
18             {
19                 run("mediaElement = document.createElement('audio')");
20
21                 mediaElement.onload = loaded;
22
23                 waitForEvent("loadstart");
24                 waitForEvent("waiting");
25                 waitForEvent("ratechange");
26                 waitForEvent("durationchange");
27                 waitForEvent("pause");
28                 waitForEvent("play");
29                 waitForEvent("playing");
30                 waitForEvent('loadeddata');
31
32                 run("mediaElement.src = 'content/test.wav'");
33                 run("mediaElement.load()");
34
35                 consoleWrite("");
36             }
37
38         </script>
39     </head>
40
41     <body onload="start()">
42
43     <p>Test that media file is not reloaded when an element is inserted into the DOM.</p>
44
45     <div id="parent"></div>
46     
47     </body>
48 </html>