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

Unified Diff: LayoutTests/media/gc-while-playing.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/media/gc-while-playing.html
diff --git a/LayoutTests/media/gc-while-playing.html b/LayoutTests/media/gc-while-playing.html
new file mode 100644
index 0000000000000000000000000000000000000000..1ac7378826c7e1a1673a301fcd3874bfbfe982ab
--- /dev/null
+++ b/LayoutTests/media/gc-while-playing.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<title>GC while playing</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
+<script>
+async_test(function(t)
+{
+ var a = document.createElement("audio");
+ a.foo = "bar";
+ a.src = findMediaFile("audio", "content/test");
+ a.onsuspend = t.step_func(function()
+ {
+ assert_equals(a.networkState, a.NETWORK_IDLE);
+ a.play();
+ // GC async since the event target is the media element.
+ setTimeout(t.step_func(gcAndAwaitTimeupdate), 0);
acolwell GONE FROM CHROMIUM 2014/09/12 16:27:25 Isn't the reference to 'a' in gcAndAwaitTimeupdate
philipj_slow 2014/09/12 19:13:00 I've updated the comments to be accurate, hopefull
+ });
+ function gcAndAwaitTimeupdate()
+ {
+ a.ontimeupdate = t.step_func(function(e)
+ {
+ assert_greater_than(e.target.currentTime, 0);
+ assert_equals(e.target.foo, "bar");
+ t.done();
+ });
+ a = null;
+ gc();
+ }
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698