adele@apple.com | ddab0f7 | 2007-12-06 20:02:21 +0000 | [diff] [blame] | 1 | <html> |
| 2 | <head> |
mihaip@chromium.org | 9d9ccc1 | 2011-02-24 23:10:46 +0000 | [diff] [blame] | 3 | <script src=media-file.js></script> |
antti@apple.com | a490c5c | 2008-01-25 21:38:28 +0000 | [diff] [blame] | 4 | <script> |
adele@apple.com | ddab0f7 | 2007-12-06 20:02:21 +0000 | [diff] [blame] | 5 | function toggleDisplay() |
| 6 | { |
| 7 | var video = document.getElementById('vid'); |
philn@webkit.org | b8b2f8f | 2011-02-16 11:13:24 +0000 | [diff] [blame] | 8 | if (video.style.display == "none") { |
adele@apple.com | ddab0f7 | 2007-12-06 20:02:21 +0000 | [diff] [blame] | 9 | video.style.display = "inline-block"; |
commit-queue@webkit.org | a2d7610 | 2011-02-23 08:27:39 +0000 | [diff] [blame] | 10 | video.addEventListener("seeked", done); |
| 11 | video.currentTime = 0; // so the snapshot always has the same frame |
philn@webkit.org | b8b2f8f | 2011-02-16 11:13:24 +0000 | [diff] [blame] | 12 | } else |
adele@apple.com | ddab0f7 | 2007-12-06 20:02:21 +0000 | [diff] [blame] | 13 | video.style.display = "none"; |
adele@apple.com | ddab0f7 | 2007-12-06 20:02:21 +0000 | [diff] [blame] | 14 | } |
| 15 | function test() |
| 16 | { |
rniwa@webkit.org | 0837233 | 2012-06-15 07:33:22 +0000 | [diff] [blame] | 17 | if (window.testRunner) |
| 18 | testRunner.waitUntilDone(); |
eric@webkit.org | 5e00a66 | 2009-09-17 22:48:32 +0000 | [diff] [blame] | 19 | setSrcById('vid', findMediaFile('video', 'content/test')); |
philn@webkit.org | 86a3c92 | 2011-02-16 16:37:24 +0000 | [diff] [blame] | 20 | var video = document.getElementById('vid'); |
commit-queue@webkit.org | a2d7610 | 2011-02-23 08:27:39 +0000 | [diff] [blame] | 21 | video.addEventListener("canplaythrough", test2); |
philn@webkit.org | 86a3c92 | 2011-02-16 16:37:24 +0000 | [diff] [blame] | 22 | video.load(); |
adele@apple.com | ddab0f7 | 2007-12-06 20:02:21 +0000 | [diff] [blame] | 23 | } |
| 24 | function test2() |
| 25 | { |
| 26 | toggleDisplay(); |
| 27 | toggleDisplay(); |
adele@apple.com | ddab0f7 | 2007-12-06 20:02:21 +0000 | [diff] [blame] | 28 | } |
commit-queue@webkit.org | a2d7610 | 2011-02-23 08:27:39 +0000 | [diff] [blame] | 29 | function done() |
| 30 | { |
rniwa@webkit.org | 0837233 | 2012-06-15 07:33:22 +0000 | [diff] [blame] | 31 | if (window.testRunner) |
| 32 | testRunner.notifyDone(); |
commit-queue@webkit.org | a2d7610 | 2011-02-23 08:27:39 +0000 | [diff] [blame] | 33 | } |
adele@apple.com | ddab0f7 | 2007-12-06 20:02:21 +0000 | [diff] [blame] | 34 | </script> |
| 35 | </head> |
| 36 | <body onload="test()"> |
| 37 | This tests that toggling the display property won't make the controls disappear.<br> |
eric@webkit.org | 5e00a66 | 2009-09-17 22:48:32 +0000 | [diff] [blame] | 38 | <video id="vid" controls></video> |
adele@apple.com | ddab0f7 | 2007-12-06 20:02:21 +0000 | [diff] [blame] | 39 | </body> |
| 40 | </html> |