Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / media / video-single-valid-source.html
blob13047a39b8ac871a371f2aec7bb2d007daff7b5f
1 <!doctype html>
2 <html>
3 <head>
4 <script src=media-file.js></script>
5 <script src=video-test.js></script>
7 <script>
9 function errorEvent()
11 logResult(false, "*** \"" + relativeURL(video.currentSrc) + "\" should not have been processed!" );
12 consoleWrite("");
13 endTest();
16 function setup()
18 video = document.createElement("video");
19 video.setAttribute("controls", "controls");
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);
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);
33 document.body.appendChild(video);
35 waitForEvent('error', errorEvent);
36 waitForEvent('loadedmetadata', endTest);
37 consoleWrite("");
40 </script>
41 </head>
42 <body onload="setup()">
44 <p>Test that a single valid &lt;source&gt; element loads correctly</p>
46 </body>
47 </html>