5 if (window
.testRunner
) {
6 testRunner
.dumpAsText();
7 testRunner
.waitUntilDone();
9 if (window
.internals
) {
10 var default_poster
= 'content/greenbox.png';
11 window
.internals
.settings
.setDefaultVideoPosterURL(default_poster
);
12 addEventListener("load", function() {
13 var poster
= window
.internals
.getImageSourceURL(document
.getElementById("video-no-poster"));
15 if (poster
== default_poster
)
16 document
.getElementById("result-no-poster").innerText
= "PASS";
18 document
.getElementById("result-no-poster").innerText
= "FAIL";
20 document
.getElementById("result-no-poster").innerText
= "FAIL: image source is null";
22 poster
= window
.internals
.getImageSourceURL(document
.getElementById("video-has-poster"));
24 if (poster
== "content/abe.png")
25 document
.getElementById("result-has-poster").innerText
= "PASS";
27 document
.getElementById("result-has-poster").innerText
= "FAIL: poster was changed";
29 document
.getElementById("result-has-poster").innerText
= "FAIL: image source is null";
31 poster
= window
.internals
.getImageSourceURL(document
.getElementById("video-has-empty-poster"));
33 if (poster
== default_poster
)
34 document
.getElementById("result-has-empty-poster").innerText
= "PASS";
36 document
.getElementById("result-has-empty-poster").innerText
= "FAIL";
38 document
.getElementById("result-has-empty-poster").innerText
= "FAIL: image source is null";
40 testRunner
.notifyDone();
47 <pre id=
"result-no-poster"></pre>
48 <pre id=
"result-has-poster"></pre>
49 <pre id=
"result-has-empty-poster"></pre>
50 <video id=
"video-no-poster" src=
"content/test.mp4" preload=
"none" />
51 <video id=
"video-has-poster" src=
"content/test.mp4" poster=
"content/abe.png" preload=
"none" />
52 <video id=
"video-has-empty-poster" src=
"content/test.mp4" poster=
"" preload=
"none" />