Bug 1358401. P3 - reject the promise in LoadTest() when AppendTrack() fails. r=gerald
authorJW Wang <jwwang@mozilla.com>
Wed, 19 Apr 2017 15:30:32 +0800
changeset 402410 02fb1ea3df4f87b92fc55894f270561c387bf483
parent 402409 cd4a2197143e67f18d3a8584f55dcee292b0a893
child 402411 f91f21db5c8e67726e0d0020c33ee3705c4d6792
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1358401
milestone55.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 1358401. P3 - reject the promise in LoadTest() when AppendTrack() fails. r=gerald MozReview-Commit-ID: 2TijR5hwyLH
dom/media/test/eme.js
--- a/dom/media/test/eme.js
+++ b/dom/media/test/eme.js
@@ -239,29 +239,27 @@ function LoadTest(test, elem, token, loa
   }
 
   var ms = new MediaSource();
   elem.src = URL.createObjectURL(ms);
 
   return new Promise(function (resolve, reject) {
     ms.addEventListener("sourceopen", function () {
       Log(token, "sourceopen");
-      return Promise.all(test.tracks.map(function(track) {
+      Promise.all(test.tracks.map(function(track) {
         return AppendTrack(test, ms, track, token, loadParams);
       })).then(function() {
         if (loadParams && loadParams.noEndOfStream) {
           Log(token, "Tracks loaded");
         } else {
           Log(token, "Tracks loaded, calling MediaSource.endOfStream()");
           ms.endOfStream();
         }
         resolve();
-      }).catch(function() {
-        Log(token, "error while loading tracks");
-      });
+      }).catch(reject);
     }, {once: true});
   });
 }
 
 function EMEPromise() {
   var self = this;
   self.promise = new Promise(function(resolve, reject) {
     self.resolve = resolve;