upload tizen1.0 source
[framework/web/webkit-efl.git] / LayoutTests / media / media-load-event.html
1 <html>
2     <head>
3         <script src=media-file.js></script>
4         <script src=video-test.js></script>
5
6         <script>
7
8             function playing()
9             {
10                 consoleWrite("EVENT(playing)<br>");
11                 endTest();
12             }
13
14             function canplaythrough()
15             {
16                 consoleWrite("EVENT(canplaythrough)");
17                 consoleWrite("");
18                 run("document.getElementById('parent').appendChild(mediaElement)");
19                 run("mediaElement.play()");
20                 consoleWrite("");
21             }
22
23             function start()
24             {
25                 run("mediaElement = document.createElement('audio')");
26
27                 mediaElement.setAttribute('oncanplaythrough', "canplaythrough()");
28                 mediaElement.setAttribute('onplaying', "playing()");
29
30                 waitForEvent("loadstart");
31                 waitForEvent("waiting");
32                 waitForEvent("ratechange");
33                 waitForEvent("durationchange");
34                 waitForEvent("pause");
35                 waitForEvent("play");
36                 waitForEvent("canplaythrough");
37                 waitForEvent('loadeddata');
38
39                 var mediaFile = findMediaFile("audio", "content/test");
40                 run("mediaElement.src = '" + mediaFile + "'");
41                 run("mediaElement.load()");
42
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>