| 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 |
| 5 (Please avoid writing new tests using video-test.js) --> |
| 4 <script src=video-test.js></script> | 6 <script src=video-test.js></script> |
| 5 <script> | 7 <script> |
| 6 video.src = findMediaFile("video", "content/test.mp4"); | 8 video.src = findMediaFile("video", "content/test.mp4"); |
| 7 | 9 |
| 8 waitForEvent("loadstart"); | 10 waitForEvent("loadstart"); |
| 9 waitForEvent("ratechange"); | 11 waitForEvent("ratechange"); |
| 10 waitForEvent("waiting"); | 12 waitForEvent("waiting"); |
| 11 waitForEvent("ratechange"); | 13 waitForEvent("ratechange"); |
| 12 waitForEvent("durationchange"); | 14 waitForEvent("durationchange"); |
| 13 waitForEvent("loadedmetadata"); | 15 waitForEvent("loadedmetadata"); |
| 14 waitForEvent("loadeddata"); | 16 waitForEvent("loadeddata"); |
| 15 waitForEvent("canplay"); | 17 waitForEvent("canplay"); |
| 16 waitForEvent("canplaythrough"); | 18 waitForEvent("canplaythrough"); |
| 17 waitForEvent("play"); | 19 waitForEvent("play"); |
| 18 waitForEvent("timeupdate"); | 20 waitForEvent("timeupdate"); |
| 19 waitForEvent('pause', function () { testExpected("video.paused", true); endT
est(); } ); | 21 waitForEvent('pause', function () { testExpected("video.paused", true); endT
est(); } ); |
| 20 | 22 |
| 21 | 23 |
| 22 run("video.play()"); | 24 run("video.play()"); |
| 23 run("video.pause()"); | 25 run("video.pause()"); |
| 24 | 26 |
| 25 consoleWrite("SCRIPT DONE"); | 27 consoleWrite("SCRIPT DONE"); |
| 26 </script> | 28 </script> |
| OLD | NEW |