Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Unified Diff: LayoutTests/http/tests/media/gc-while-network-loading.html

Issue 552303006: Prevent more script-observable cases of HTMLMediaElement GC (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: cleanup Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698