OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>AudioTrack & VideoTrack garbage collection</title> | 4 <title>AudioTrack & VideoTrack garbage collection</title> |
5 <script src="../../resources/testharness.js"></script> | 5 <script src="../../resources/testharness.js"></script> |
6 <script src="../../resources/testharnessreport.js"></script> | 6 <script src="../../resources/testharnessreport.js"></script> |
7 <script src="../media-file.js"></script> | 7 <script src="../media-file.js"></script> |
8 </head> | 8 </head> |
9 <body> | 9 <body> |
10 <div id="log"></div> | 10 <div id="log"></div> |
11 <script> | 11 <script> |
12 async_test(function(t) | 12 async_test(function(t) |
13 { | 13 { |
14 var e = document.createElement('video'); | 14 var e = document.createElement('video'); |
| 15 // add to body to prevent GC pending http://crbug.com/400659 |
| 16 document.body.appendChild(e); |
15 e.src = findMediaFile('video', '../content/test'); | 17 e.src = findMediaFile('video', '../content/test'); |
16 | 18 |
17 e.addEventListener('loadedmetadata', t.step_func(function() | 19 e.addEventListener('loadedmetadata', t.step_func(function() |
18 { | 20 { |
19 e.audioTracks.foo = 'foo'; | 21 e.audioTracks.foo = 'foo'; |
20 e.audioTracks[0].bar = 'bar'; | 22 e.audioTracks[0].bar = 'bar'; |
21 e.videoTracks.baz = 'baz'; | 23 e.videoTracks.baz = 'baz'; |
22 e.videoTracks[0].qux = 'qux'; | 24 e.videoTracks[0].qux = 'qux'; |
23 | 25 |
24 gc(); | 26 gc(); |
25 | 27 |
26 assert_equals(e.audioTracks.foo, 'foo'); | 28 assert_equals(e.audioTracks.foo, 'foo'); |
27 assert_equals(e.audioTracks[0].bar, 'bar'); | 29 assert_equals(e.audioTracks[0].bar, 'bar'); |
28 assert_equals(e.videoTracks.baz, 'baz'); | 30 assert_equals(e.videoTracks.baz, 'baz'); |
29 assert_equals(e.videoTracks[0].qux, 'qux'); | 31 assert_equals(e.videoTracks[0].qux, 'qux'); |
30 | 32 |
31 t.done(); | 33 t.done(); |
32 })); | 34 })); |
33 }); | 35 }); |
34 </script> | 36 </script> |
35 </body> | 37 </body> |
36 </html> | 38 </html> |
OLD | NEW |