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

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: make gc-while-seeking.html non-flaky 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/media/media-source/mediasource-closed-on-htmlmediaelement-destruction.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..caf03b4bf6bad64cb28defdae1a5716f7d423d91
--- /dev/null
+++ b/LayoutTests/http/tests/media/gc-while-network-loading.html
@@ -0,0 +1,33 @@
+<!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.
+ // Continue after a timeout since the current event target is the media
+ // element, which means that it cannot be garbage collected now.
+ 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>
« no previous file with comments | « no previous file | LayoutTests/http/tests/media/media-source/mediasource-closed-on-htmlmediaelement-destruction.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698