OLD | NEW |
---|---|
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <script src="../../resources/testharness.js"></script> |
3 <head> | 3 <script src="../../resources/testharnessreport.js"></script> |
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 <style> |
6 (Please avoid writing new tests using video-test.js) --> | 6 video { |
7 <script src="../../media/video-test.js"></script> | 7 -webkit-box-reflect: below 0px; |
8 <script type="text/javascript"> | 8 border: 3px solid red; |
9 var testedOnce = false; | 9 } |
10 if (window.testRunner) { | 10 </style> |
11 window.testRunner.dumpAsTextWithPixelResults(); | 11 <video></video> |
12 window.testRunner.waitUntilDone(); | 12 <script> |
13 } | 13 async_test(function(t) { |
fs
2016/08/18 08:50:45
Not sure if testharness makes much sense here - th
Srirama
2016/08/18 10:04:03
Acknowledged.
| |
14 function runTest() { | 14 testRunner.dumpAsTextWithPixelResults(); |
15 video = document.getElementById('video'); | 15 video = document.querySelector('video'); |
16 video.addEventListener('canplaythrough', canplaythrough, true); | 16 video.src = findMediaFile('video', '../../media/content/test'); |
17 video.src = findMediaFile('video', '../../media/content/test'); | |
18 } | |
19 function canplaythrough(e) { | |
20 var video = e.target; | |
21 video.addEventListener('seeked', seeked, true); | |
22 video.currentTime = 1; | |
23 } | |
24 function seeked(e) { | |
25 if (!testedOnce) { | |
26 testExpected('video.currentTime', 1); | |
27 | 17 |
28 if (window.testRunner) | 18 testRunner.waitUntilDone(); |
29 setTimeout(function() { testRunner.notifyDone(); }, 150) ; | 19 video.onseeked = t.step_func(function() { |
20 video.onseeked = null; | |
21 assert_equals(video.currentTime, 1); | |
30 | 22 |
31 testedOnce = true; | 23 setTimeout(t.step_func(function() { testRunner.notifyDone(); }), 150); |
fs
2016/08/18 08:50:45
This timeout looks very gratuitous - could we perh
Srirama
2016/08/18 10:04:03
Done.
| |
32 } | 24 }); |
33 } | 25 |
34 </script> | 26 video.currentTime = 1; |
35 <style> | 27 }); |
36 video { | 28 </script> |
37 -webkit-box-reflect: below 0px; | |
38 border: 3px solid red; | |
39 } | |
40 </style> | |
41 </head> | |
42 <body onload="runTest()"> | |
43 <video id="video"></video> | |
44 </body> | |
45 </html> | |
OLD | NEW |