OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <title>Test currentTime values when setting while readystate is HAVE_NOTHING.</t
itle> |
3 <head> | 3 <script src="../resources/testharness.js"></script> |
4 <script src=media-file.js></script> | 4 <script src="../resources/testharnessreport.js"></script> |
5 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 | 5 <script src="media-file.js"></script> |
6 (Please avoid writing new tests using video-test.js) --> | 6 <video></video> |
7 <script src=video-test.js></script> | 7 <script> |
8 <script> | 8 async_test(function(t) { |
9 function onWindowLoad(e) | 9 var video = document.querySelector("video"); |
10 { | 10 video.src = findMediaFile("video", "content/test"); |
11 video = document.getElementById('video'); | 11 assert_equals(video.currentTime, 0); |
| 12 video.currentTime = 1; |
| 13 assert_equals(video.currentTime, 1); |
12 | 14 |
13 video.src = findMediaFile("video", "content/test"); | 15 video.onloadedmetadata = t.step_func(function() { |
14 testExpected("video.currentTime", 0); | 16 assert_equals(video.currentTime, 1); |
15 video.currentTime = 1; | 17 }); |
16 testExpected("video.currentTime", 1); | |
17 | 18 |
18 waitForEvent('loadedmetadata', function() | 19 video.onseeked = t.step_func_done(); |
19 { | 20 }); |
20 testExpected("video.currentTime", 1); | 21 </script> |
21 }); | |
22 | |
23 waitForEventAndEnd('seeked'); | |
24 } | |
25 | |
26 window.addEventListener('load', onWindowLoad, false); | |
27 </script> | |
28 </head> | |
29 <body> | |
30 <video controls id="video"></video> | |
31 <p>Test currentTime values when setting while HAVE_NOTHING.</p> | |
32 <br/> | |
33 </body> | |
34 </html> | |
OLD | NEW |