[Modern Media Controls] Turn media/modern-media-controls/ios-inline-media-controls...
[WebKit-https.git] / LayoutTests / media / video-poster-blocked-by-willsendrequest.html
1 <!doctype html>
2 <html>
3     <head>
4         <style>
5             video {
6                 border: 3px solid red;
7                 background-color: magenta;
8             }
9         </style>
10
11         <script src=video-test.js></script>
12         <script>
13         
14             var width, height;
15         
16             function testAfterLoadingPoster()
17             {
18                 consoleWrite("<br><b>Test after setting poster</b>");
19
20                 testExpected("video.clientWidth", 300);
21                 testExpected("video.clientHeight", 150);
22
23                 endTest();
24             }
25
26             function start()
27             {
28                 if (window.testRunner) {
29                     testRunner.dumpAsText();
30                     testRunner.setWillSendRequestReturnsNull(true);
31                 } else
32                     consoleWrite("<b>This test can only be run in DumpRenderTree!</b>");
33
34                 video = document.querySelectorAll('video')[0];
35
36                 consoleWrite("<br><b>Testing before setting poster</b>");
37                 testExpected("video.clientWidth", 300);
38                 testExpected("video.clientHeight", 150);
39
40                 // FIXME: the getTime() below works around a bug (82976) in mac DRT where caches aren't cleared between tests.
41                 video.poster = "content/abe.png?" + (new Date().getTime());
42
43                 setTimeout(testAfterLoadingPoster, 100);
44             }
45         </script>
46     </head>
47
48     <body onload="start()">
49         <video id=video></video>
50         <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=65270">https://bugs.webkit.org/show_bug.cgi?id=65270</a>. <br>
51         Resource load delegate should be able to block poster loading.</p>
52     </body>
53 </html>