Add the default video poster if it doesn't exist in video tag
[WebKit-https.git] / LayoutTests / media / video-no-default-poster.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script>
5   if (window.testRunner) {
6     testRunner.dumpAsText();
7     testRunner.waitUntilDone();
8   }
9
10   if (window.internals) {
11     addEventListener("load", function() {
12       var poster = window.internals.getImageSourceURL(document.getElementById("video-no-poster"));
13       if (poster)
14         document.getElementById("result-no-poster").innerText = "FAIL : poster was added.";
15       else
16         document.getElementById("result-no-poster").innerText = "PASS";
17
18       poster = window.internals.getImageSourceURL(document.getElementById("video-has-poster"));
19       if (poster) {
20         if (poster == "content/abe.png")
21           document.getElementById("result-has-poster").innerText = "PASS";
22         else
23           document.getElementById("result-has-poster").innerText = "FAIL: poster was changed";
24       } else
25         document.getElementById("result-has-poster").innerText = "FAIL: Image source is null";
26
27       testRunner.notifyDone();
28     }, false);
29   }
30
31 </script>
32 </head>
33 <body>
34 <pre id="result-no-poster"></pre>
35 <pre id="result-has-poster"></pre>
36 <video id="video-no-poster" src="content/test.mp4" preload="none" />
37 <video id="video-has-poster" src="content/test.mp4" poster="content/abe.png" preload="none" />
38 </body>
39 </html>