OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
| 3 <script src="../resources/run-after-display.js"></script> |
3 <style> | 4 <style> |
4 video { | 5 video { |
5 width: 400px; | 6 width: 400px; |
6 height: 300px; | 7 height: 300px; |
7 } | 8 } |
8 </style> | 9 </style> |
9 <script type="text/javascript" charset="utf-8"> | 10 <script type="text/javascript" charset="utf-8"> |
10 if (window.testRunner) { | 11 if (window.testRunner) { |
11 testRunner.dumpAsTextWithPixelResults(); | 12 testRunner.dumpAsTextWithPixelResults(); |
12 testRunner.waitUntilDone(); | 13 testRunner.waitUntilDone(); |
13 } | 14 } |
14 </script> | 15 </script> |
15 </head> | 16 </head> |
16 <body> | 17 <body> |
17 <video></video> | 18 <video></video> |
18 <script> | 19 <script> |
19 var video = document.getElementsByTagName('video')[0]; | 20 var video = document.getElementsByTagName('video')[0]; |
20 video.src = 'resources/video.' + (video.canPlayType('video/ogg') ? 'ogv' : '
mp4'); | 21 video.src = 'resources/video.' + (video.canPlayType('video/ogg') ? 'ogv' : '
mp4'); |
21 video.addEventListener('canplaythrough', function() { | 22 video.addEventListener('canplaythrough', function() { |
22 if (window.testRunner) { | 23 if (window.testRunner) { |
23 testRunner.display(); | 24 runAfterDisplay(function() { |
24 testRunner.setPageVisibility("hidden"); | 25 testRunner.setPageVisibility("hidden"); |
25 testRunner.display(); | 26 testRunner.notifyDone(); |
26 testRunner.notifyDone(); | 27 }); |
27 } | 28 } |
28 }, false); | 29 }, false); |
29 </script> | 30 </script> |
30 </body> | 31 </body> |
31 </html> | 32 </html> |
OLD | NEW |