[Modern Media Controls] Turn media/modern-media-controls/ios-inline-media-controls...
[WebKit-https.git] / LayoutTests / media / video-src-invalid-poster.html
1 <script src=video-test.js></script>
2 <video poster="content/abe.png">
3     <source src="content/bogus" type="bogus">
4 </video>
5 <script>
6     findMediaElement();
7
8     function listenForWidthAndHeight(expectedWidth, expectedHeight, callback) {
9         if (video.clientWidth == expectedWidth && video.clientHeight == expectedHeight) {
10             callback();
11         } else {
12             // This uses a 20ms sleep loop to accomplish the wait, since the
13             // standard specifies no events that fire on poster load or error.
14             window.setTimeout(listenForWidthAndHeight, 20, expectedWidth, expectedHeight, callback);
15         }
16     }
17
18     function expected() {
19         testExpected("video.clientWidth", 76);
20         testExpected("video.clientHeight", 103);
21         endTest();
22     }
23
24     run("video.load()");
25     waitForEvent("loadstart", function () {
26         listenForWidthAndHeight(76, 103, expected);
27     });
28 </script>