| OLD | NEW |
| 1 <html> | 1 <!DOCTYPE html> |
| 2 <head> | 2 <title>Test that the load eventually suspends and returns to NETWORK_IDLE.</titl
e> |
| 3 <script src=../../media-resources/media-file.js></script> | 3 <script src="../resources/testharness.js"></script> |
| 4 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 | 4 <script src="../resources/testharnessreport.js"></script> |
| 5 (Please avoid writing new tests using video-test.js) --> | 5 <script src="../../media-resources/media-file.js"></script> |
| 6 <script src=../../media-resources/video-test.js></script> | 6 <video></video> |
| 7 <script> | 7 <script> |
| 8 var file = findMediaFile("video", "http://127.0.0.1:8000/resources/test"); | 8 async_test(function(t) { |
| 9 | 9 var video = document.querySelector("video"); |
| 10 function init() | 10 video.src = findMediaFile("video", "http://127.0.0.1:8000/resources/test"); |
| 11 { | 11 var watcher = new EventWatcher(t, video, ["loadstart", "suspend"]); |
| 12 findMediaElement(); | 12 watcher.wait_for(["loadstart", "suspend"]).then(t.step_func_done(function()
{ |
| 13 run("video.src = file"); | 13 assert_equals(video.networkState, HTMLMediaElement.NETWORK_IDLE); |
| 14 waitForEvent('loadstart', onLoadStart); | 14 })); |
| 15 } | 15 }); |
| 16 | 16 </script> |
| 17 function onLoadStart() | |
| 18 { | |
| 19 waitForEvent('suspend', onSuspend); | |
| 20 } | |
| 21 | |
| 22 function onSuspend() | |
| 23 { | |
| 24 testExpected("video.networkState", HTMLMediaElement.NETWORK_IDLE, "=="); | |
| 25 endTest(); | |
| 26 } | |
| 27 </script> | |
| 28 </head> | |
| 29 <body onload="init()"> | |
| 30 <p>Test that the load eventually suspends and returns to NETWORK_IDLE.</p> | |
| 31 <video></video> | |
| 32 </body> | |
| 33 </html> | |
| OLD | NEW |