Bug 1358401. P4 - reject the promise with an error string in UpdateSessionFunc(). r=gerald
authorJW Wang <jwwang@mozilla.com>
Fri, 21 Apr 2017 15:35:41 +0800
changeset 402411 f91f21db5c8e
parent 402410 02fb1ea3df4f
child 402412 ba94dfa2c7f3
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. P4 - reject the promise with an error string in UpdateSessionFunc(). r=gerald MozReview-Commit-ID: 2bFb9NBQPxk
dom/media/test/eme.js
--- a/dom/media/test/eme.js
+++ b/dom/media/test/eme.js
@@ -126,32 +126,31 @@ function UpdateSessionFunc(test, token, 
       if (key) {
         Log(token, "found key " + key + " for key id " + idHex);
         outKeys.push({
           "kty":"oct",
           "kid":id64,
           "k":HexToBase64(key)
         });
       } else {
-        bail(token + " couldn't find key for key id " + idHex)("No such key");
+        reject(`${token} couldn't find key for key id ${idHex}`);
       }
     }
 
     var update = JSON.stringify({
       "keys" : outKeys,
       "type" : msg.type
     });
     Log(token, "sending update message to CDM: " + update);
 
     ev.target.update(StringToArrayBuffer(update)).then(function() {
       Log(token, "MediaKeySession update ok!");
       resolve(ev.target);
     }).catch(function(reason) {
-      bail(token + " MediaKeySession update failed")(reason);
-      reject();
+      reject(`${token} MediaKeySession update failed: ${reason}`);
     });
   }
 }
 
 function MaybeCrossOriginURI(test, uri)
 {
   if (test.crossOrigin) {
     return "http://test2.mochi.test:8888/tests/dom/media/test/allowed.sjs?" + uri;