| OLD | NEW |
| 1 <html> | 1 <!DOCTYPE html> |
| 2 <body> | 2 <title>Test that the playing event is not fired when video has no src.</title> |
| 3 <video controls></video> | 3 <script src="../resources/testharness.js"></script> |
| 4 <script src="../resources/testharnessreport.js"></script> |
| 5 <video></video> |
| 6 <script> |
| 7 async_test(function(t) { |
| 8 var video = document.querySelector("video"); |
| 4 | 9 |
| 5 <p>Video has no src. Test that the playing event is not dispatched.</p> | 10 video.onplaying = t.unreached_func(); |
| 11 video.onloadstart = t.step_func(function() {}); |
| 12 video.ontimeupdate = t.step_func(function() {}); |
| 13 video.onwaiting = t.step_func(function() {}); |
| 6 | 14 |
| 7 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 | 15 video.onpause = t.step_func_done(function() { |
| 8 (Please avoid writing new tests using video-test.js) --> | 16 assert_equals(video.networkState, HTMLMediaElement.NETWORK_EMPTY); |
| 9 <script src=video-test.js></script> | 17 }); |
| 10 <script> | |
| 11 waitForEventAndFail('playing'); | |
| 12 | 18 |
| 13 waitForEvent("loadstart"); | 19 video.play(); |
| 14 waitForEvent("timeupdate"); | 20 video.pause(); |
| 15 waitForEvent("waiting"); | 21 }); |
| 16 | 22 </script> |
| 17 function onpause() | |
| 18 { | |
| 19 testExpected("video.networkState", HTMLMediaElement.NETWORK_EMPTY); | |
| 20 endTest(); | |
| 21 consoleWrite(""); | |
| 22 } | |
| 23 | |
| 24 waitForEvent("pause", onpause); | |
| 25 | |
| 26 run("video.play()"); | |
| 27 run("video.pause()"); | |
| 28 </script> | |
| 29 </body> | |
| 30 </html> | |
| OLD | NEW |