| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../media/media-file.js"></script> | 4 <script src="../../media/media-file.js"></script> |
| 5 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 | 5 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 |
| 6 (Please avoid writing new tests using video-test.js) --> | 6 (Please avoid writing new tests using video-test.js) --> |
| 7 <script src="../../media/video-test.js"></script> | 7 <script src="../../media/video-test.js"></script> |
| 8 <script type="text/javascript"> | 8 <script type="text/javascript"> |
| 9 var testedOnce = false; |
| 9 if (window.testRunner) { | 10 if (window.testRunner) { |
| 10 window.testRunner.dumpAsTextWithPixelResults(); | 11 window.testRunner.dumpAsTextWithPixelResults(); |
| 11 window.testRunner.waitUntilDone(); | 12 window.testRunner.waitUntilDone(); |
| 12 } | 13 } |
| 13 function runTest() { | 14 function runTest() { |
| 14 video = document.getElementById('video'); | 15 video = document.getElementById('video'); |
| 15 video.addEventListener('canplaythrough', canplaythrough, true); | 16 video.addEventListener('canplaythrough', canplaythrough, true); |
| 16 video.src = findMediaFile('video', '../../media/content/test'); | 17 video.src = findMediaFile('video', '../../media/content/test'); |
| 17 } | 18 } |
| 18 function canplaythrough(e) { | 19 function canplaythrough(e) { |
| 19 var video = e.target; | 20 var video = e.target; |
| 20 video.addEventListener('seeked', seeked, true); | 21 video.addEventListener('seeked', seeked, true); |
| 21 video.currentTime = 1; | 22 video.currentTime = 1; |
| 22 } | 23 } |
| 23 function seeked(e) { | 24 function seeked(e) { |
| 24 testExpected('video.currentTime', 1); | 25 if (!testedOnce) { |
| 26 testExpected('video.currentTime', 1); |
| 25 | 27 |
| 26 if (window.testRunner) | 28 if (window.testRunner) |
| 27 setTimeout(function() { testRunner.notifyDone(); }, 150); | 29 setTimeout(function() { testRunner.notifyDone(); }, 150)
; |
| 30 |
| 31 testedOnce = true; |
| 32 } |
| 28 } | 33 } |
| 29 </script> | 34 </script> |
| 30 <style> | 35 <style> |
| 31 video { | 36 video { |
| 32 -webkit-box-reflect: below 0px; | 37 -webkit-box-reflect: below 0px; |
| 33 border: 3px solid red; | 38 border: 3px solid red; |
| 34 } | 39 } |
| 35 </style> | 40 </style> |
| 36 </head> | 41 </head> |
| 37 <body onload="runTest()"> | 42 <body onload="runTest()"> |
| 38 <video id="video"></video> | 43 <video id="video"></video> |
| 39 </body> | 44 </body> |
| 40 </html> | 45 </html> |
| OLD | NEW |