OLD | NEW |
1 <html> | 1 <html> |
2 <body> | 2 <body> |
3 | 3 |
4 <video controls></video> | 4 <video controls></video> |
5 | 5 |
6 <p>Test that setting currentTime changes the time, and that 'ended' event is
fired in a reasonable amount of time</p> | 6 <p>Test that setting currentTime changes the time, and that 'ended' event is
fired in a reasonable amount of time</p> |
7 | 7 |
8 <script src=media-file.js></script> | 8 <script src=media-file.js></script> |
| 9 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 |
| 10 (Please avoid writing new tests using video-test.js) --> |
9 <script src=video-test.js></script> | 11 <script src=video-test.js></script> |
10 <script> | 12 <script> |
11 waitForEventOnce('canplaythrough', | 13 waitForEventOnce('canplaythrough', |
12 function () { | 14 function () { |
13 waitForEventAndEnd('ended'); | 15 waitForEventAndEnd('ended'); |
14 | 16 |
15 testExpected("video.currentTime", 0); | 17 testExpected("video.currentTime", 0); |
16 run("video.currentTime = video.duration - 0.2"); | 18 run("video.currentTime = video.duration - 0.2"); |
17 }); | 19 }); |
18 | 20 |
19 waitForEvent('seeked', | 21 waitForEvent('seeked', |
20 function () { | 22 function () { |
21 testExpected("video.currentTime.toFixed(2)", (video.duration - 0.2).toFi
xed(2)); | 23 testExpected("video.currentTime.toFixed(2)", (video.duration - 0.2).toFi
xed(2)); |
22 run("video.play()"); | 24 run("video.play()"); |
23 consoleWrite(""); | 25 consoleWrite(""); |
24 }); | 26 }); |
25 | 27 |
26 video.src = findMediaFile("video", "content/test"); | 28 video.src = findMediaFile("video", "content/test"); |
27 </script> | 29 </script> |
28 | 30 |
29 </body> | 31 </body> |
30 </html> | 32 </html> |
OLD | NEW |