2 <title>GC while networkState is NETWORK_LOADING
</title>
3 <script src=
"../resources/testharness.js"></script>
4 <script src=
"../resources/testharnessreport.js"></script>
5 <script src=
"../../media-resources/media-file.js"></script>
9 var v
= document
.createElement("video");
11 var mediaFile
= findMediaFile("video", "../../../media/content/test");
12 var type
= mimeTypeForExtension(mediaFile
.split(".").pop());
13 v
.src
= "http://127.0.0.1:8000/media/video-throttled-load.cgi?name=" + mediaFile
+ "&throttle=50&type=" + type
;
14 v
.onloadeddata
= t
.step_func(function()
16 assert_equals(v
.networkState
, v
.NETWORK_LOADING
);
17 // The delaying-the-load-event flag is now false.
18 // Continue after a timeout since the current event target is the media
19 // element, which means that it cannot be garbage collected now.
20 setTimeout(t
.step_func(gcAndAwaitProgress
), 0);
22 function gcAndAwaitProgress()
24 v
.onprogress
= t
.step_func(function(e
)
26 assert_equals(e
.target
.foo
, "bar");