Bug 1092979 - Add mochitest to ensure loadedmetada is emitted as early as possible. r=cajbir
☠☠ backed out by 382044a16179 ☠ ☠
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 06 Nov 2014 21:03:39 +1100
changeset 214383 1c969fba2f6487a8ea3769091ab68ff6db82689a
parent 214382 006c4625df019c61b63b49a24a7b2fad22b1456e
child 214384 70a72a19cb4b2940d31d49951ffeef9b35c7c718
push id27780
push userkwierso@gmail.com
push dateFri, 07 Nov 2014 02:25:05 +0000
treeherdermozilla-central@e6d47abb6a7b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscajbir
bugs1092979
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1092979 - Add mochitest to ensure loadedmetada is emitted as early as possible. r=cajbir
dom/media/mediasource/test/mochitest.ini
dom/media/mediasource/test/test_LoadedMetadataFired.html
--- a/dom/media/mediasource/test/mochitest.ini
+++ b/dom/media/mediasource/test/mochitest.ini
@@ -5,14 +5,16 @@ support-files =
   seek.webm seek.webm^headers^
   seek_lowres.webm seek_lowres.webm^headers^
 
 [test_MediaSource.html]
 [test_MediaSource_disabled.html]
 [test_BufferedSeek.html]
 [test_FrameSelection.html]
 [test_HaveMetadataUnbufferedSeek.html]
+[test_LoadedMetadataFired.html]
 [test_SeekableAfterEndOfStream.html]
 [test_SeekableAfterEndOfStreamSplit.html]
 [test_SeekableBeforeEndOfStream.html]
 [test_SeekableBeforeEndOfStreamSplit.html]
 [test_SplitAppendDelay.html]
 [test_SplitAppend.html]
+
new file mode 100644
--- /dev/null
+++ b/dom/media/mediasource/test/test_LoadedMetadataFired.html
@@ -0,0 +1,35 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <title>MSE: append initialization only</title>
+  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="text/javascript" src="mediasource.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+</head>
+<body>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+
+SimpleTest.waitForExplicitFinish();
+
+runWithMSE(function (ms, v) {
+  ms.addEventListener("sourceopen", function () {
+    var sb = ms.addSourceBuffer("video/webm");
+
+    v.addEventListener("loadedmetadata", function () {
+      ok(true, "Got loadedmetadata event");
+      SimpleTest.finish();
+    });
+
+    fetchWithXHR("seek.webm", function (arrayBuffer) {
+      sb.appendBuffer(new Uint8Array(arrayBuffer, 0, 318));
+      v.play();
+    });
+  });
+
+});
+
+</script>
+</pre>
+</body>
+</html>