Bug 1065215 - Fix EME test for changes to MediaSource::endOfStream - r=cpearce
☠☠ backed out by b538f9579103 ☠ ☠
authorChris Double <chris.double@double.co.nz>
Wed, 12 Nov 2014 15:53:47 +1300
changeset 215145 39fcd286ce68e385d10155e9b3dcd785c83db95d
parent 215144 471009c10ae057cbc714955da124668e66501fd0
child 215146 f96e3c57e1d838c5e99b9cfd7731811f3184050b
push id51672
push usercdouble@mozilla.com
push dateWed, 12 Nov 2014 02:56:04 +0000
treeherdermozilla-inbound@39fcd286ce68 [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++];