OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src=media-file.js></script> | 4 <script src=media-file.js></script> |
| 5 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 |
| 6 (Please avoid writing new tests using video-test.js) --> |
5 <script src=video-test.js></script> | 7 <script src=video-test.js></script> |
6 <script> | 8 <script> |
7 var timeupdateEventCount = 0; | 9 var timeupdateEventCount = 0; |
8 | 10 |
9 function doSetup() | 11 function doSetup() |
10 { | 12 { |
11 findMediaElement(); | 13 findMediaElement(); |
12 waitForEvent('canplaythrough', canPlayThrough); | 14 waitForEvent('canplaythrough', canPlayThrough); |
13 video.src = findMediaFile('video', 'content/test'); | 15 video.src = findMediaFile('video', 'content/test'); |
14 } | 16 } |
15 window.addEventListener('load', doSetup, false); | 17 window.addEventListener('load', doSetup, false); |
16 | 18 |
17 function canPlayThrough() | 19 function canPlayThrough() |
18 { | 20 { |
19 testExpected("video.paused", true); | 21 testExpected("video.paused", true); |
20 testExpected("video.ended", false); | 22 testExpected("video.ended", false); |
21 video.addEventListener('timeupdate', timeUpdate); | 23 video.addEventListener('timeupdate', timeUpdate); |
22 run("video.play()"); | 24 run("video.play()"); |
23 } | 25 } |
24 | 26 |
25 function timeUpdate() | 27 function timeUpdate() |
26 { | 28 { |
27 ++timeupdateEventCount; | 29 ++timeupdateEventCount; |
28 | 30 |
29 // Wait 2 timeupdate events so we are sure the media engine is | 31 // Wait 2 timeupdate events so we are sure the media engine is |
30 // playing the media. | 32 // playing the media. |
31 if (timeupdateEventCount == 2) { | 33 if (timeupdateEventCount == 2) { |
32 consoleWrite(""); | 34 consoleWrite(""); |
33 video.removeEventListener('timeupdate', timeUpdate); | 35 video.removeEventListener('timeupdate', timeUpdate); |
34 // Make sure time is advancing. | 36 // Make sure time is advancing. |
(...skipping 26 matching lines...) Expand all Loading... |
61 timeupdateEventCount = 0; | 63 timeupdateEventCount = 0; |
62 endTest(); | 64 endTest(); |
63 } | 65 } |
64 </script> | 66 </script> |
65 </head> | 67 </head> |
66 <body> | 68 <body> |
67 <video controls></video> | 69 <video controls></video> |
68 <p>Test that seeking a paused video past its end sets currentTime to dur
ation and leaves the video paused.</p> | 70 <p>Test that seeking a paused video past its end sets currentTime to dur
ation and leaves the video paused.</p> |
69 </body> | 71 </body> |
70 </html> | 72 </html> |
OLD | NEW |