blob: e8382bd5684e1db7ac40013853119d5184b99cc3 [file] [log] [blame]
[email protected]0c6f8e42009-07-30 16:05:021<html>
2 <head>
[email protected]b61b47d2011-02-24 23:10:463 <script src=media-file.js></script>
4 <script src=video-test.js></script>
[email protected]0c6f8e42009-07-30 16:05:025
6 <script>
7
[email protected]02a554d82009-08-20 17:21:358 function playing()
[email protected]0c6f8e42009-07-30 16:05:029 {
[email protected]02a554d82009-08-20 17:21:3510 consoleWrite("EVENT(playing)<br>");
11 endTest();
12 }
13
[email protected]7bdbeb82009-10-19 17:13:0814 function canplaythrough()
[email protected]02a554d82009-08-20 17:21:3515 {
[email protected]7bdbeb82009-10-19 17:13:0816 consoleWrite("EVENT(canplaythrough)");
[email protected]0c6f8e42009-07-30 16:05:0217 consoleWrite("");
[email protected]1b9d3402009-08-06 21:09:2418 run("document.getElementById('parent').appendChild(mediaElement)");
19 run("mediaElement.play()");
[email protected]0c6f8e42009-07-30 16:05:0220 consoleWrite("");
21 }
22
23 function start()
24 {
[email protected]1b9d3402009-08-06 21:09:2425 run("mediaElement = document.createElement('audio')");
[email protected]0c6f8e42009-07-30 16:05:0226
[email protected]7bdbeb82009-10-19 17:13:0827 mediaElement.setAttribute('oncanplaythrough', "canplaythrough()");
[email protected]02a554d82009-08-20 17:21:3528 mediaElement.setAttribute('onplaying', "playing()");
[email protected]0c6f8e42009-07-30 16:05:0229
30 waitForEvent("loadstart");
31 waitForEvent("waiting");
32 waitForEvent("ratechange");
33 waitForEvent("durationchange");
34 waitForEvent("pause");
35 waitForEvent("play");
[email protected]4ce81952009-10-26 15:27:5736 waitForEvent("canplaythrough");
[email protected]0c6f8e42009-07-30 16:05:0237 waitForEvent('loadeddata');
38
[email protected]e12b7ef2009-09-24 01:20:4339 var mediaFile = findMediaFile("audio", "content/test");
40 run("mediaElement.src = '" + mediaFile + "'");
[email protected]1b9d3402009-08-06 21:09:2441 run("mediaElement.load()");
[email protected]0c6f8e42009-07-30 16:05:0242
43 consoleWrite("");
44 }
45
46 </script>
47 </head>
48
49 <body onload="start()">
50
51 <p>Test that media file is not reloaded when an element is inserted into the DOM.</p>
52
53 <div id="parent"></div>
54
55 </body>
56</html>