OLD | NEW |
1 <video controls></video> | 1 <video controls></video> |
2 <p>Test that calling play() and pause() triggers async play, timeupdate and paus
e events.</p> | 2 <p>Test that calling play() and pause() triggers async play, timeupdate and paus
e events.</p> |
3 <script src=media-file.js></script> | 3 <script src=media-file.js></script> |
4 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 | 4 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 |
5 (Please avoid writing new tests using video-test.js) --> | 5 (Please avoid writing new tests using video-test.js) --> |
6 <script src=video-test.js></script> | 6 <script src=video-test.js></script> |
7 <script> | 7 <script> |
8 video.src = findMediaFile("video", "content/test.mp4"); | 8 video.src = findMediaFile("video", "content/test.mp4"); |
9 | 9 |
10 waitForEvent("loadstart"); | 10 waitForEvent("loadstart"); |
11 waitForEvent("ratechange"); | 11 waitForEvent("ratechange"); |
12 waitForEvent("waiting"); | 12 waitForEvent("waiting"); |
13 waitForEvent("ratechange"); | 13 waitForEvent("ratechange"); |
14 waitForEvent("durationchange"); | 14 waitForEvent("durationchange"); |
15 waitForEvent("loadedmetadata"); | 15 waitForEvent("loadedmetadata"); |
16 waitForEvent("loadeddata"); | 16 waitForEvent("loadeddata"); |
17 waitForEvent("canplay"); | 17 waitForEvent("canplay"); |
18 waitForEvent("canplaythrough"); | 18 waitForEvent("canplaythrough"); |
19 waitForEvent("play"); | 19 waitForEvent("play"); |
20 waitForEvent("timeupdate"); | 20 waitForEvent("timeupdate"); |
21 waitForEvent('pause', function () { testExpected("video.paused", true); endT
est(); } ); | 21 waitForEvent('pause', function () { testExpected("video.paused", true); endT
est(); } ); |
22 | 22 |
23 | 23 |
24 run("video.play()"); | 24 run("video.play()"); |
25 run("video.pause()"); | 25 run("video.pause()"); |
26 | 26 |
27 consoleWrite("SCRIPT DONE"); | 27 consoleWrite("SCRIPT DONE"); |
28 </script> | 28 </script> |
OLD | NEW |