Add new access object callback
[framework/web/webkit-efl.git] / LayoutTests / media / video-source-error-no-candidate.html
1 <html lang="en">
2     <head>
3         <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
4         <title>&lt;video&gt; and &lt;source&gt; error test</title>
5         <script src=video-test.js></script>
6
7         <script>
8
9             var sources = [];
10             var errorCount = 0;
11             var expectedErrorCount = 5;
12
13             function errorEvent(evt)
14             {
15                 consoleWrite("");
16
17                 var ndx;
18                 for (ndx = 0; ndx < sources.length; ndx++) {
19                     if (sources[ndx] == evt.target)
20                         break;
21                 }
22
23                 var src = sources[ndx].getAttribute('src') == null ? "null" : "'" + relativeURL(evt.target.src) + "'";
24                 if (sources[ndx] == evt.target)
25                     logResult(true, "EVENT(error) from &lt;source id='<em>" + evt.target.id + "</em>' src=<em>" + src + "</em>&gt;");
26                 else
27                     logResult(false, "EVENT(error) from " + evt.target);
28
29                 testExpected("video.error", null);
30                 
31                 if (++errorCount == expectedErrorCount) {
32                     consoleWrite("");
33                     setTimeout(endTest, 200);
34                 }
35             }
36
37             function start()
38             {
39                 document.addEventListener("error", errorEvent, true);
40
41                 sources = document.getElementsByTagName('source');
42
43                 findMediaElement();
44             }
45         </script>
46     </head>
47
48     <body>
49
50        <video onloadstart="start()" controls>
51             <source id=missing-src type="video/blahblah">
52             <source id=bogus-type src=content/test.mp4 type="video/blahblah">
53             <source id=unsupported-media-query src=content/test.mp4 media=print>
54             <source id=empty-src src="" type="video/mp4">
55             <source id=no-extension-no-type src=nonexistent>
56         </video>
57         
58         <p>Test that 'error' events are fired from &lt;source&gt; element when it can not be used.</p>
59
60     </body>
61 </html>