Bug 1342913: P1. Add mochitest. r=gerald a=test-only
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 08 Mar 2017 00:28:13 +1100
changeset 395269 2f8ff57bf637eab3dc8b39ecf15510fb41cebeb5
parent 395268 f264eb5dd1eb960acdd908255ec34648466df010
child 395270 af228c5bb2a60f45c04411cdd41025af3785a285
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald, test-only
bugs1342913
milestone54.0a2
Bug 1342913: P1. Add mochitest. r=gerald a=test-only MozReview-Commit-ID: IaU4tIm0Wze
dom/media/mediasource/test/mochitest.ini
dom/media/mediasource/test/test_ChangeWhileWaitingOnMissingData_mp4.html
--- a/dom/media/mediasource/test/mochitest.ini
+++ b/dom/media/mediasource/test/mochitest.ini
@@ -49,16 +49,18 @@ skip-if = ((os == "win" && os_version ==
 tags = firstpartyisolation
 [test_BufferedSeek.html]
 [test_BufferedSeek_mp4.html]
 skip-if = ((os == "win" && os_version == "5.1") || (toolkit == 'android')) # Not supported on xp and android 2.3
 [test_BufferingWait.html]
 skip-if = toolkit == 'android' #timeout android bug 1199531
 [test_BufferingWait_mp4.html]
 skip-if = ((os == "win" && os_version == "5.1") || (toolkit == 'android')) # Not supported on xp and android 2.3
+[test_ChangeWhileWaitingOnMissingData_mp4.html]
+skip-if = ((os == "win" && (os_version == "5.1" || os_version == "6.2")) || (toolkit == 'android')) # Not supported on xp and android 2.3, win8 see bug 1347101
 [test_DrainOnMissingData_mp4.html]
 skip-if = ((os == "win" && os_version == "5.1") || (toolkit == 'android')) # Not supported on xp and android 2.3
 [test_DurationChange.html]
 [test_DurationUpdated.html]
 [test_DurationUpdated_mp4.html]
 skip-if = ((os == "win" && os_version == "5.1") || (toolkit == 'android')) # Not supported on xp and android 2.3
 [test_EndedEvent.html]
 [test_EndOfStream.html]
new file mode 100644
--- /dev/null
+++ b/dom/media/mediasource/test/test_ChangeWhileWaitingOnMissingData_mp4.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html><head>
+<meta http-equiv="content-type" content="text/html; charset=windows-1252">
+  <title>MSE: resume from waiting even after format change occurred</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, el) {
+  el.controls = true;
+  once(ms, 'sourceopen').then(function() {
+    ok(true, "Receive a sourceopen event");
+    var sb = ms.addSourceBuffer("video/mp4");
+    fetchAndLoad(sb, 'bipbop/bipbop_480_624kbps-video', ['init'], '.mp4')
+    .then(fetchAndLoad.bind(null, sb, 'bipbop/bipbop_480_624kbps-video', range(1, 3), '.m4s'))
+    .then(function() {
+      el.play();
+      // let seek to the last audio frame.
+      // The seek will complete and then playback will stall.
+      el.currentTime = 1.532517;
+      return Promise.all([once(el, 'seeked'), once(el, 'stalled')]);
+    })
+    .then(function() {
+      info("seek completed");
+      return fetchAndLoad(sb, 'bipbop/bipbop', ['init'], '.mp4');
+    })
+    .then(fetchAndLoad.bind(null, sb, 'bipbop/bipbop', range(1, 4), '.m4s'))
+    .then(function() {
+      ms.endOfStream();
+      return once(el, 'ended');
+    }).then(function() {
+      SimpleTest.finish();
+    });
+  });
+});
+
+</script>
+</pre>
+</body>
+</html>