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>
9 var a
= document
.createElement("audio");
11 a
.src
= findMediaFile("audio", "content/test");
12 a
.onsuspend
= t
.step_func(function()
14 assert_equals(a
.networkState
, a
.NETWORK_IDLE
);
16 // Continue after a timeout since the current event target is the media
17 // element, which means that it cannot be garbage collected now.
18 setTimeout(t
.step_func(gcAndAwaitTimeupdate
), 0);
20 function gcAndAwaitTimeupdate()
22 a
.ontimeupdate
= t
.step_func(function(e
)
24 assert_greater_than(e
.target
.currentTime
, 0);
25 assert_equals(e
.target
.foo
, "bar");