| <html> |
| <head> |
| <script src=media-file.js></script> |
| <script src=video-test.js></script> |
| <script> |
| function start() { |
| findMediaElement(); |
| |
| var suspendCount = 0; |
| |
| // Make sure we've at least reached NETWORK_LOADING before waiting for suspend. |
| waitForEvent('loadstart', function() { |
| // suspend event means the user agent has intentionally paused network usage, |
| // however we should still receive timeupdate events. |
| mediaElement.addEventListener('suspend', function () { |
| // timeupdate events are fired as playback progresses so only verify that at least one |
| // event is fired |
| ++suspendCount; |
| if (suspendCount == 1) { |
| consoleWrite("EVENT(suspend)"); |
| waitForEventAndEnd('timeupdate'); |
| } |
| } ); |
| } ); |
| |
| var mediaFile = findMediaFile("video", "resources/test"); |
| video.src = "http://127.0.0.1:8000/" + mediaFile; |
| run("video.play()"); |
| } |
| </script> |
| </head> |
| <body onload="start()"> |
| <video></video> |
| <p>Test that timeupdate events are sent when media loading suspends itself.</p> |
| </body> |
| </html> |