OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
philipj_slow
2015/12/02 14:02:14
You can omit <html>, <head> and such:
https://www.
Srirama
2015/12/02 14:39:18
Done.
| |
3 <head> | |
4 <title>GC with a pending event in an inactive document</title> | |
5 <script src="../resources/testharness.js"></script> | |
6 <script src="../resources/testharnessreport.js"></script> | |
7 <script src="media-file.js"></script> | |
8 <script> | |
9 function start() { | |
philipj_slow
2015/12/02 14:02:14
You don't need a start(), just put the script afte
Srirama
2015/12/02 14:39:18
Done.
| |
10 async_test(function(t) { | |
11 var iframeDocument = document.getElementById('iframe1').cont entDocument.document; | |
12 var video = document.getElementById('iframe1').contentDocume nt.querySelector('video'); | |
13 video.src = findMediaFile("video", "content/test"); | |
14 video.onloadeddata = this.step_func(function() { | |
15 video.onloadeddata = null; | |
16 assert_true(video.networkState == video.NETWORK_IDLE || video.networkState == video.NETWORK_LOADING); | |
17 assert_greater_than(video.readyState, video.HAVE_NOTHING ); | |
philipj_slow
2015/12/02 14:02:14
Actually s/HAVE_NOTHING/HAVE_METADATA/ since we ju
Srirama
2015/12/02 14:39:18
Done.
| |
18 // Move the video element to main document | |
19 // from iframe and verify that it loads properly | |
20 document.body.appendChild(video); | |
21 assert_equals(video.networkState, video.NETWORK_NO_SOURC E); | |
22 assert_equals(video.readyState, video.HAVE_NOTHING); | |
23 var actual_events = []; | |
24 var expected_events = ['emptied', 'loadstart', 'loadedda ta']; | |
25 expected_events.forEach(function(type) { | |
26 video.addEventListener(type, t.step_func(function() { | |
27 actual_events.push(type); | |
28 if (type == 'loadeddata') { | |
29 assert_array_equals(actual_events, expected_ events); | |
30 t.done(); | |
31 } | |
32 })); | |
33 }); | |
34 }); | |
35 }); | |
36 } | |
37 </script> | |
38 </head> | |
39 <body onload='start()'> | |
40 <iframe id="iframe1" srcdoc="<html><body><video controls></video></body> </html>"></iframe> | |
Srirama
2015/12/02 13:30:52
Couldn't find a better way than using srcdoc. Keep
philipj_slow
2015/12/02 14:02:14
What you can do is to have an empty video and an e
Srirama
2015/12/02 14:39:18
Done.
| |
41 </body> | |
42 </html> | |
OLD | NEW |