| Index: LayoutTests/http/tests/media/gc-while-network-loading.html
|
| diff --git a/LayoutTests/http/tests/media/gc-while-network-loading.html b/LayoutTests/http/tests/media/gc-while-network-loading.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..781c512b76d00c1c298d2b0dec5e2a5f5399a911
|
| --- /dev/null
|
| +++ b/LayoutTests/http/tests/media/gc-while-network-loading.html
|
| @@ -0,0 +1,32 @@
|
| +<!DOCTYPE html>
|
| +<title>GC while networkState is NETWORK_LOADING</title>
|
| +<script src="../resources/testharness.js"></script>
|
| +<script src="../resources/testharnessreport.js"></script>
|
| +<script src="../../media-resources/media-file.js"></script>
|
| +<script>
|
| +async_test(function(t)
|
| +{
|
| + var v = document.createElement("video");
|
| + v.foo = "bar";
|
| + var mediaFile = findMediaFile("video", "../../../media/content/test");
|
| + var type = mimeTypeForExtension(mediaFile.split(".").pop());
|
| + v.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?name=" + mediaFile + "&throttle=50&type=" + type;
|
| + v.onloadeddata = t.step_func(function()
|
| + {
|
| + assert_equals(v.networkState, v.NETWORK_LOADING);
|
| + // The delaying-the-load-event flag is now false.
|
| + // GC async since the event target is the media element.
|
| + setTimeout(t.step_func(gcAndAwaitProgress), 0);
|
| + });
|
| + function gcAndAwaitProgress()
|
| + {
|
| + v.onprogress = t.step_func(function(e)
|
| + {
|
| + assert_equals(e.target.foo, "bar");
|
| + t.done();
|
| + });
|
| + v = null;
|
| + gc();
|
| + }
|
| +});
|
| +</script>
|
|
|