Add new access object callback
[framework/web/webkit-efl.git] / LayoutTests / media / video-src-none.html
1 <!DOCTYPE html>
2 <html>
3     <head>
4         <script src=video-test.js></script>
5         <script>
6             var state;
7
8             function someTimeLater()
9             {
10                 testExpected("state", "load() with missing 'src'");
11                 testExpected("videos[0].error", null);
12                 testExpected("videos[0].networkState", HTMLMediaElement.NETWORK_EMPTY);
13                 testExpected("videos[0].src", "");
14                 endTest();
15             }
16
17             function errorEvent()
18             {
19                 failTest("<br><i>***'error' event fired***<" + "/i>");
20             }
21
22             function test()
23             {
24                 videos = document.querySelectorAll('video');
25
26                 consoleWrite("<br><i>Network state should remain in NETWORK_EMPTY with missing 'src' attribute.<" + "/i>");
27                 consoleWrite("** &lt;video&gt; with no src attribute**");
28                 testExpected("videos[0].error", null);
29                 testExpected("videos[0].networkState", HTMLMediaElement.NETWORK_EMPTY);
30                 testExpected("videos[0].src", "");
31
32                 consoleWrite("<br><i>Calling load() with no 'src' should NOT fire 'error' event, set network state to NETWORK_EMPTY.<" + "/i>");
33                 state = "load() with missing 'src'";
34                 videos[0].load();
35
36                 setTimeout(someTimeLater, 100) ;
37             }
38         </script>
39     </head>
40
41     <body onload="setTimeout(test, 100)">
42         <video width=320 height=60 controls onerror="errorEvent()"></video>
43     </body>
44 </html>