Chromium Code Reviews| OLD | NEW | 
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script src="/w3c/resources/testharness.js"></script> | |
| 5 <script src="/w3c/resources/testharnessreport.js"></script> | |
| 6 </head> | |
| 7 <body> | |
| 8 <script> | |
| 9 async_test(function(test) | |
| 10 { | |
| 11 var receivedLoadEvent = false; | |
| 12 | |
| 13 window.addEventListener("load", test.step_func(function() { | |
| 14 assert_false(receivedLoadEvent, "window should not receive m ultiple load events"); | |
| 15 receivedLoadEvent = true; | |
| 16 }), false); | |
| 
 
foolip
2016/06/20 09:30:12
Trailing false is not needed.
 
wolenetz
2016/06/21 22:25:47
Done.
 
 | |
| 17 | |
| 18 assert_equals(document.readyState, "loading", "document should n ot be complete yet"); | |
| 19 var video = document.createElement("video"); | |
| 20 var mediaSource = new MediaSource(); | |
| 21 | |
| 22 // |video| should stop delaying the load event long before eithe r a | |
| 23 // "progress", "stalled" or "suspend" event are enqueued. | |
| 24 video.addEventListener("suspend", test.unreached_func("unexpecte d 'suspend' event")); | |
| 25 video.addEventListener("stalled", test.unreached_func("unexpecte d 'stalled' event")); | |
| 26 video.addEventListener("progress", test.unreached_func("unexpect ed 'progress' event")); | |
| 27 | |
| 28 // No error is expected. | |
| 29 video.addEventListener("error", test.unreached_func("unexpected 'error' event")); | |
| 30 | |
| 31 mediaSource.addEventListener("sourceopen", test.step_func(functi on() { | |
| 32 assert_true(receivedLoadEvent, "load event should have been received first"); | |
| 
 
foolip
2016/06/20 09:30:12
It looks to me like the implementation would first
 
wolenetz
2016/06/21 22:25:47
Acknowledged.
 
wolenetz
2016/09/02 23:00:57
I've filed https://crbug.com/643846 to follow-up o
 
 | |
| 33 assert_equals(video.networkState, video.NETWORK_LOADING); | |
| 34 assert_equals(video.readyState, video.HAVE_NOTHING); | |
| 35 assert_equals(document.readyState, "complete", "document sho uld be complete"); | |
| 36 test.done(); | |
| 37 })); | |
| 38 | |
| 39 var mediaSourceURL = URL.createObjectURL(mediaSource); | |
| 40 document.body.appendChild(video); | |
| 
 
foolip
2016/06/20 09:30:12
Test should run fine without appending unless ther
 
wolenetz
2016/06/21 22:25:47
Done. And reconfirmed that without the .cpp portio
 
 | |
| 41 video.src = mediaSourceURL; | |
| 42 test.add_cleanup(function() { | |
| 43 document.body.removeChild(video); | |
| 
 
foolip
2016/06/20 09:30:12
Removing the video from the document ought not mat
 
wolenetz
2016/06/21 22:25:47
Done.
 
 | |
| 44 URL.revokeObjectURL(mediaSourceURL); | |
| 45 }); | |
| 46 }, "MediaSource attachment should immediately stop delaying the load event"); | |
| 47 </script> | |
| 48 </body> | |
| 49 </html> | |
| OLD | NEW |