| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src=../../media-resources/media-file.js></script> | 3 <script src=../../media-resources/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=../../media-resources/video-test.js></script> | 6 <script src=../../media-resources/video-test.js></script> |
| 5 <script> | 7 <script> |
| 6 var file = findMediaFile("video", "http://127.0.0.1:8000/resources/test"); | 8 var file = findMediaFile("video", "http://127.0.0.1:8000/resources/test"); |
| 7 | 9 |
| 8 function init() | 10 function init() |
| 9 { | 11 { |
| 10 findMediaElement(); | 12 findMediaElement(); |
| 11 run("video.src = file"); | 13 run("video.src = file"); |
| 12 waitForEvent('loadstart', onLoadStart); | 14 waitForEvent('loadstart', onLoadStart); |
| 13 } | 15 } |
| 14 | 16 |
| 15 function onLoadStart() | 17 function onLoadStart() |
| 16 { | 18 { |
| 17 waitForEvent('suspend', onSuspend); | 19 waitForEvent('suspend', onSuspend); |
| 18 } | 20 } |
| 19 | 21 |
| 20 function onSuspend() | 22 function onSuspend() |
| 21 { | 23 { |
| 22 testExpected("video.networkState", HTMLMediaElement.NETWORK_IDLE, "=="); | 24 testExpected("video.networkState", HTMLMediaElement.NETWORK_IDLE, "=="); |
| 23 endTest(); | 25 endTest(); |
| 24 } | 26 } |
| 25 </script> | 27 </script> |
| 26 </head> | 28 </head> |
| 27 <body onload="init()"> | 29 <body onload="init()"> |
| 28 <p>Test that the load eventually suspends and returns to NETWORK_IDLE.</p> | 30 <p>Test that the load eventually suspends and returns to NETWORK_IDLE.</p> |
| 29 <video></video> | 31 <video></video> |
| 30 </body> | 32 </body> |
| 31 </html> | 33 </html> |
| OLD | NEW |