OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <title>GC while playing</title> | |
3 <script src="../resources/testharness.js"></script> | |
4 <script src="../resources/testharnessreport.js"></script> | |
5 <script src="media-file.js"></script> | |
6 <script> | |
7 async_test(function(t) | |
8 { | |
9 var a = document.createElement("audio"); | |
10 a.foo = "bar"; | |
11 a.src = findMediaFile("audio", "content/test"); | |
12 a.onsuspend = t.step_func(function() | |
13 { | |
14 assert_equals(a.networkState, a.NETWORK_IDLE); | |
15 a.play(); | |
16 // GC async since the event target is the media element. | |
17 setTimeout(t.step_func(gcAndAwaitTimeupdate), 0); | |
acolwell GONE FROM CHROMIUM
2014/09/12 16:27:25
Isn't the reference to 'a' in gcAndAwaitTimeupdate
philipj_slow
2014/09/12 19:13:00
I've updated the comments to be accurate, hopefull
| |
18 }); | |
19 function gcAndAwaitTimeupdate() | |
20 { | |
21 a.ontimeupdate = t.step_func(function(e) | |
22 { | |
23 assert_greater_than(e.target.currentTime, 0); | |
24 assert_equals(e.target.foo, "bar"); | |
25 t.done(); | |
26 }); | |
27 a = null; | |
28 gc(); | |
29 } | |
30 }); | |
31 </script> | |
OLD | NEW |