[Release] Webkit-EFL Ver. 2.0_beta_118996_0.6.22
[framework/web/webkit-efl.git] / LayoutTests / media / video-single-valid-source.html
1 <!doctype html>
2 <html>
3     <head>
4         <script src=media-file.js></script>
5         <script src=video-test.js></script>
6         
7         <script>
8     
9             function errorEvent()
10             {
11                 logResult(false, "*** \"" + relativeURL(video.currentSrc) + "\" should not have been processed!" );
12                 consoleWrite("");
13                 endTest();
14             }
15     
16             function setup()
17             {
18                 video = document.createElement("video");
19                 video.setAttribute("controls", "controls");
20
21                 // The first source should load.
22                 var source = document.createElement("source");
23                 source.setAttribute("src", findMediaFile("video", "content/test"));
24                 source.setAttribute("type", mimeTypeForFile(source.getAttribute("src")));
25                 video.appendChild(source);
26
27                 // The second source is bogus and won't load, but it should never be processed.
28                 source = document.createElement("source");
29                 source.setAttribute("src", findMediaFile("video", "content/does-not-exist"));
30                 source.setAttribute("type", mimeTypeForFile(source.getAttribute("src")));
31                 video.appendChild(source);
32
33                 document.body.appendChild(video);
34
35                 waitForEvent('error', errorEvent);
36                 waitForEvent('loadedmetadata', endTest);
37                 consoleWrite("");
38             }
39
40         </script>
41     </head>
42 <body onload="setup()">
43
44     <p>Test that a single valid &lt;source&gt; element loads correctly</p>
45
46 </body>
47 </html>