Index: LayoutTests/http/tests/media/media-source/mediasource-htmlmediaelement-lifetime.html |
diff --git a/LayoutTests/http/tests/media/media-source/mediasource-htmlmediaelement-lifetime.html b/LayoutTests/http/tests/media/media-source/mediasource-htmlmediaelement-lifetime.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7e1b1a2f5d7d783c73b6c0f5d891ddf5dc3e74fd |
--- /dev/null |
+++ b/LayoutTests/http/tests/media/media-source/mediasource-htmlmediaelement-lifetime.html |
@@ -0,0 +1,48 @@ |
+<!DOCTYPE html> |
+<html> |
+ <head> |
+ <script src="/js-test-resources/js-test.js"></script> |
+ <script src="/media-resources/video-test.js"></script> |
+ <script src="/w3c/resources/testharness.js"></script> |
+ <script src="/w3c/resources/testharnessreport.js"></script> |
+ <script src="mediasource-util.js"></script> |
+ </head> |
+ <body> |
+ <div id="log"></div> |
+ <script> |
+ window.jsTestIsAsync = true; |
+ |
+ async_test(function(test) |
+ { |
+ var video = document.createElement("video"); |
+ var ms = new MediaSource(); |
+ |
+ function sourceOpened() |
+ { |
+ consoleWrite("sourceOpened called."); |
+ var buffer = ms.addSourceBuffer('video/webm; codecs="vorbis,vp8"'); |
+ |
+ consoleWrite("Running the garbage collector."); |
+ video = null; |
+ asyncGC(test.step_func(function() |
+ { |
+ assert_equals(ms.readyState, "open", "MediaSource object is open."); |
+ |
+ consoleWrite("Setting MediaSource duration."); |
+ ms.duration = 100; |
+ })); |
+ } |
+ |
+ function durationChanged() |
+ { |
+ consoleWrite("durationChanged called."); |
+ test.done(); |
+ } |
+ |
+ ms.addEventListener("sourceopen", test.step_func(sourceOpened)); |
+ video.addEventListener("durationchange", test.step_func(durationChanged)); |
+ video.src = window.URL.createObjectURL(ms); |
+ }, "Tests that the MediaSource keeps the HTMLMediaElement alive."); |
+ </script> |
+ </body> |
+</html> |