Bug 1065215 - Fix EME test for changes to MediaSource::endOfStream - r=cpearce
☠☠ backed out by d008dbf3e9f0 ☠ ☠
authorChris Double <chris.double@double.co.nz>
Thu, 13 Nov 2014 10:47:38 +1300
changeset 215392 462fde31c8804406d259f9b4d4656b04a601af8b
parent 215391 ea9e204bc97a19bf19244ff235a99f7f9f337cbb
child 215393 f53ad1a63b5898b8155dc5e83b754fd109e0cb3c
push id51743
push usercdouble@mozilla.com
push dateThu, 13 Nov 2014 01:15:54 +0000
treeherdermozilla-inbound@f53ad1a63b58 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1065215
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 1065215 - Fix EME test for changes to MediaSource::endOfStream - r=cpearce
dom/media/test/eme.js
--- a/dom/media/test/eme.js
+++ b/dom/media/test/eme.js
@@ -116,16 +116,25 @@ function PlayFragmented(test, elem, toke
   return new Promise(function(resolve, reject) {
     var ms = new MediaSource();
     elem.src = URL.createObjectURL(ms);
 
     var sb;
     var curFragment = 0;
 
     function addNextFragment() {
+      /* We can get another updateevent as a result of calling ms.endOfStream() if
+         the highest end time of our source buffers is different from that of the
+         media source duration. Due to bug 1065207 this can happen because of
+         inaccuracies in the frame duration calculations. Check if we are already
+         "ended" and ignore the update event */
+      if (ms.readyState == "ended") {
+        return;
+      }
+
       if (curFragment >= test.fragments.length) {
         Log(token, "addNextFragment() end of stream");
         ms.endOfStream();
         resolve();
         return;
       }
 
       var fragmentFile = test.fragments[curFragment++];