OLD | NEW |
| 1 <!DOCTYPE html> |
| 2 <title>Test that stalling very early, while loading meta-data, stops delaying th
e load event.</title> |
| 3 <script src="../resources/testharness.js"></script> |
| 4 <script src="../resources/testharnessreport.js"></script> |
| 5 <script src="../../media-resources/media-file.js"></script> |
1 <video></video> | 6 <video></video> |
2 <p>Test that stalling very early, while loading meta-data, stops delaying the lo
ad event.</p> | |
3 <script src=../../media-resources/media-file.js></script> | |
4 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 | |
5 (Please avoid writing new tests using video-test.js) --> | |
6 <script src=../../media-resources/video-test.js></script> | |
7 <script> | 7 <script> |
| 8 async_test(function(t) { |
| 9 var video = document.querySelector("video"); |
8 | 10 |
9 // Expected events. | 11 var expectedEvents = ["loadstart", "stalled"]; |
10 waitForEvent("loadstart"); | 12 var watcher = new EventWatcher(t, video, expectedEvents); |
11 waitForEvent("stalled"); | 13 watcher.wait_for(expectedEvents).then(t.step_func(function() { |
12 waitForEvent("suspend"); | 14 // We want to make sure the onload event fires. |
13 | 15 window.onload = t.step_func_done(); |
14 // We want to make sure the onload event fires. | 16 })); |
15 window.onload = function() { | |
16 consoleWrite("EVENT(window.onload)"); | |
17 endTest(); | |
18 }; | |
19 | 17 |
20 // Find a supported media file. | 18 // Find a supported media file. |
21 var mediaFile = findMediaFile("video", "content/test"); | 19 var mediaFile = findMediaFile("video", "content/test"); |
22 var mimeType = mimeTypeForFile(mediaFile); | 20 var mimeType = mimeTypeForFile(mediaFile); |
23 | 21 |
24 // Load should stall very early in the loading process. | 22 // Load should stall very early in the loading process. |
25 video.src = "http://127.0.0.1:8000/resources/load-and-stall.cgi?name=../../.
./media/" + mediaFile + "&mimeType=" + mimeType + "&stallAt=1&stallFor=4"; | 23 video.src = "http://127.0.0.1:8000/resources/load-and-stall.cgi?name=../../.
./media/" + mediaFile + "&mimeType=" + mimeType + "&stallAt=1&stallFor=4"; |
26 | 24 }); |
27 </script> | 25 </script> |
OLD | NEW |