blob: 83aae3674380b67cf7cbc382d920b381ba0c2447 [file] [log] [blame]
adele@apple.comddab0f72007-12-06 20:02:21 +00001<html>
2 <head>
mihaip@chromium.org9d9ccc12011-02-24 23:10:46 +00003 <script src=media-file.js></script>
antti@apple.coma490c5c2008-01-25 21:38:28 +00004 <script>
adele@apple.comddab0f72007-12-06 20:02:21 +00005 function toggleDisplay()
6 {
7 var video = document.getElementById('vid');
philn@webkit.orgb8b2f8f2011-02-16 11:13:24 +00008 if (video.style.display == "none") {
adele@apple.comddab0f72007-12-06 20:02:21 +00009 video.style.display = "inline-block";
commit-queue@webkit.orga2d76102011-02-23 08:27:39 +000010 video.addEventListener("seeked", done);
11 video.currentTime = 0; // so the snapshot always has the same frame
philn@webkit.orgb8b2f8f2011-02-16 11:13:24 +000012 } else
adele@apple.comddab0f72007-12-06 20:02:21 +000013 video.style.display = "none";
adele@apple.comddab0f72007-12-06 20:02:21 +000014 }
15 function test()
16 {
rniwa@webkit.org08372332012-06-15 07:33:22 +000017 if (window.testRunner)
18 testRunner.waitUntilDone();
eric@webkit.org5e00a662009-09-17 22:48:32 +000019 setSrcById('vid', findMediaFile('video', 'content/test'));
philn@webkit.org86a3c922011-02-16 16:37:24 +000020 var video = document.getElementById('vid');
commit-queue@webkit.orga2d76102011-02-23 08:27:39 +000021 video.addEventListener("canplaythrough", test2);
philn@webkit.org86a3c922011-02-16 16:37:24 +000022 video.load();
adele@apple.comddab0f72007-12-06 20:02:21 +000023 }
24 function test2()
25 {
26 toggleDisplay();
27 toggleDisplay();
adele@apple.comddab0f72007-12-06 20:02:21 +000028 }
commit-queue@webkit.orga2d76102011-02-23 08:27:39 +000029 function done()
30 {
rniwa@webkit.org08372332012-06-15 07:33:22 +000031 if (window.testRunner)
32 testRunner.notifyDone();
commit-queue@webkit.orga2d76102011-02-23 08:27:39 +000033 }
adele@apple.comddab0f72007-12-06 20:02:21 +000034 </script>
35 </head>
36 <body onload="test()">
37 This tests that toggling the display property won't make the controls disappear.<br>
eric@webkit.org5e00a662009-09-17 22:48:32 +000038 <video id="vid" controls></video>
adele@apple.comddab0f72007-12-06 20:02:21 +000039 </body>
40</html>