Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / media / video-src-none.html
blobae9e521d5c111e25c2f6ca7db8aa1c09eacc81d1
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src=video-test.js></script>
5 <script>
6 var state;
8 function someTimeLater()
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();
17 function errorEvent()
19 failTest("<br><i>***'error' event fired***<" + "/i>");
22 function test()
24 videos = document.querySelectorAll('video');
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", "");
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();
36 setTimeout(someTimeLater, 100) ;
38 </script>
39 </head>
41 <body onload="setTimeout(test, 100)">
42 <video width=320 height=60 controls onerror="errorEvent()"></video>
43 </body>
44 </html>