Bug 1143514: Update mochitest. r=cajbir a=sledru
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 18 Mar 2015 14:10:57 +1100
changeset 248528 a16d6cee20ca008a49468b8e57f0f6fe8745db22
parent 248527 72140ae7649f4e25bc56a2620612ad285c75ba34
child 248529 177744c2bea9ec8a3ca11cb9bd7e48a41f713e79
push id7853
push userjyavenard@mozilla.com
push dateMon, 30 Mar 2015 09:10:51 +0000
treeherdermozilla-aurora@a16d6cee20ca [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscajbir, sledru
bugs1143514
milestone38.0a2
Bug 1143514: Update mochitest. r=cajbir a=sledru sourcebuffer is added to ms.activeSourceBuffers only once the first init segment has been appended.
dom/media/mediasource/test/test_MediaSource.html
--- a/dom/media/mediasource/test/test_MediaSource.html
+++ b/dom/media/mediasource/test/test_MediaSource.html
@@ -42,17 +42,18 @@ runWithMSE(function () {
 
   ms.addEventListener("sourceopen", function () {
     ok(true, "Receive a sourceopen event");
     is(ms.readyState, "open", "MediaSource must be in open state after sourceopen");
     var sb = ms.addSourceBuffer("video/webm");
     ok(sb, "Create a SourceBuffer");
     is(ms.sourceBuffers.length, 1, "MediaSource.sourceBuffers is expected length");
     is(ms.sourceBuffers[0], sb, "SourceBuffer in list matches our SourceBuffer");
-    is(ms.activeSourceBuffers[0], sb, "SourceBuffer in active list matches our SourceBuffer");
+    is(ms.activeSourceBuffers.length, 0, "MediaSource.activeSourceBuffers is expected length");
+
 
     fetchWithXHR("seek.webm", function (arrayBuffer) {
       sb.appendBuffer(new Uint8Array(arrayBuffer));
       is(sb.updating, true, "SourceBuffer.updating is expected value after appendBuffer");
     });
 
     sb.addEventListener("update", function () {
       is(sb.updating, false, "SourceBuffer.updating is expected value in update event");
@@ -65,16 +66,17 @@ runWithMSE(function () {
       }
     });
 
     sb.addEventListener("updatestart", function () {
       updatestartCount++;
     });
 
     sb.addEventListener("updateend", function () {
+      is(ms.activeSourceBuffers[0], sb, "SourceBuffer in active list matches our SourceBuffer");
       is(sb.updating, false, "SourceBuffer.updating is expected value in updateend event");
       updateendCount++;
       v.play();
     });
   });
 
   ms.addEventListener("sourceended", function () {
     ok(true, "Receive a sourceended event");