Backed out changeset c58f5ffb38e0 (bug 1142379)
authorWes Kocher <wkocher@mozilla.com>
Mon, 23 Mar 2015 16:06:30 -0700
changeset 265477 e55d9b57b37b1d35c836833006194f9baa1e0585
parent 265476 17a3ab95bb74fe8bedb59d39ff7de654e8f7b5d8
child 265478 7167a20b3bf885e1b1eedd3ae43a967e8771384d
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1142379
milestone39.0a1
backs outc58f5ffb38e02c56bbe29d615c8444b413f9e88e
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
Backed out changeset c58f5ffb38e0 (bug 1142379)
dom/media/test/bipbop-cenc1-audio1.m4s
dom/media/test/bipbop-cenc1-audio2.m4s
dom/media/test/bipbop-cenc1-audio3.m4s
dom/media/test/bipbop-cenc1-audioinit.mp4
dom/media/test/bipbop-cenc1-video1.m4s
dom/media/test/bipbop-cenc1-video2.m4s
dom/media/test/bipbop-cenc1-videoinit.mp4
dom/media/test/bipbop-frag-cenc-audio.xml
dom/media/test/bipbop-frag-cenc-video.xml
dom/media/test/eme.js
dom/media/test/manifest.js
dom/media/test/mochitest.ini
dom/media/test/test_eme_canvas_blocked.html
dom/media/test/test_eme_obs_notification.html
dom/media/test/test_eme_persistent_sessions.html
dom/media/test/test_eme_playback.html
dom/media/test/test_eme_stream_capture_blocked.html
deleted file mode 100644
index 63cfd66f7efcb521dc8e4f23a01388e83d99ec55..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 04a6cb6ff9cf667ea61919481798f93c2f412c9a..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index ad0cd72f903ff3149e647188abf92ea9063898cb..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 1fb0078c1d12df70680265da41d39d674bcff667..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 755013c11c8fd9ceff7983a372ff84e826e88a74..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index c884bd95fc441e684b6e544a9fb02a1c0be44565..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 41160099c82f0785ff01c5fbd9abe5627c46be7a..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/dom/media/test/bipbop-frag-cenc-audio.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-  This XML file describes the encryption applied to |bipbop-cenc*|. To
-  generate the bipbop-cenc1 files, run the following commands:
-
-  # Encrypt bipbop-no-edts.mp4 with the keys specified in this file,
-  # and output to |bipbop-cenc1-{video,audio}.mp4|
-  MP4Box -crypt bipbop-frag-cenc-video.xml -rem 2 -out bipbop-cenc1-video.mp4 bipbop-no-edts.mp4
-  MP4Box -crypt bipbop-frag-cenc-audio.xml -rem 1 -out bipbop-cenc1-audio.mp4 bipbop-no-edts.mp4
-
-  # Fragment |bipbop-cenc1-*.mp4| into 500ms segments:
-  MP4Box -dash 500 -rap -segment-name bipbop-cenc1-video -subsegs-per-sidx 5 bipbop-cenc1-video.mp4
-  MP4Box -dash 500 -rap -segment-name bipbop-cenc1-audio -subsegs-per-sidx 5 bipbop-cenc1-audio.mp4
-
-  # The above command will generate a set of fragments in |bipbop-cenc1-{video,audio}*.m4s
-  # and |bipbop-cenc1-{video,audio}init.mp4| containing just the init segment.
-
-  # To cut down the duration, we throw out all but the first 3 audio & 2 video segments:
-  rm bipbop-cenc1-audio{[^123],[123][^.]}.m4s
-  rm bipbop-cenc1-video{[^12],[12][^.]}.m4s
-
-  # MP4Box will also have generated some *.mpd files we don't need:
-  rm bipbop-cenc1-*.mpd
-
-  # Delete intermediate encrypted files:
-  rm bipbop-cenc1-{audio,video}.mp4
--->
-
-<GPACDRM type="CENC AES-CTR">
-
-  <DRMInfo type="pssh" version="1">
-    <!--
-    SystemID specified in
-    https://dvcs.w3.org/hg/html-media/raw-file/tip/encrypted-media/cenc-format.html
-    -->
-    <BS ID128="1077efecc0b24d02ace33c1e52e2fb4b" />
-    <!-- Number of KeyIDs = 1 -->
-    <BS bits="32" value="1" />
-    <!-- KeyID -->
-    <BS ID128="0x7e571d047e571d047e571d047e571d04" />
-  </DRMInfo>
-
-  <CrypTrack trackID="2" isEncrypted="1" IV_size="16" saiSavedBox="senc"
-    first_IV="0x00000000000000000000000000000000">
-    <key KID="0x7e571d047e571d047e571d047e571d04"
-      value="0x7e5744447e5744447e5744447e574444" />
-  </CrypTrack>
-
-</GPACDRM>
deleted file mode 100644
--- a/dom/media/test/bipbop-frag-cenc-video.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-  This XML file describes the encryption applied to |bipbop-cenc*|. To
-  generate the bipbop-cenc1 files, run the following commands:
-
-  # Encrypt bipbop-no-edts.mp4 with the keys specified in this file,
-  # and output to |bipbop-cenc1-{video,audio}.mp4|
-  MP4Box -crypt bipbop-frag-cenc-video.xml -rem 2 -out bipbop-cenc1-video.mp4 bipbop-no-edts.mp4
-  MP4Box -crypt bipbop-frag-cenc-audio.xml -rem 1 -out bipbop-cenc1-audio.mp4 bipbop-no-edts.mp4
-
-  # Fragment |bipbop-cenc1-*.mp4| into 500ms segments:
-  MP4Box -dash 500 -rap -segment-name bipbop-cenc1-video -subsegs-per-sidx 5 bipbop-cenc1-video.mp4
-  MP4Box -dash 500 -rap -segment-name bipbop-cenc1-audio -subsegs-per-sidx 5 bipbop-cenc1-audio.mp4
-
-  # The above command will generate a set of fragments in |bipbop-cenc1-{video,audio}*.m4s
-  # and |bipbop-cenc1-{video,audio}init.mp4| containing just the init segment.
-
-  # To cut down the duration, we throw out all but the first 3 audio & 2 video segments:
-  rm bipbop-cenc1-audio{[^123],[123][^.]}.m4s
-  rm bipbop-cenc1-video{[^12],[12][^.]}.m4s
-
-  # MP4Box will also have generated some *.mpd files we don't need:
-  rm bipbop-cenc1-*.mpd
-
-  # Delete intermediate encrypted files:
-  rm bipbop-cenc1-{audio,video}.mp4
--->
-
-<GPACDRM type="CENC AES-CTR">
-
-  <DRMInfo type="pssh" version="1">
-    <!--
-    SystemID specified in
-    https://dvcs.w3.org/hg/html-media/raw-file/tip/encrypted-media/cenc-format.html
-    -->
-    <BS ID128="1077efecc0b24d02ace33c1e52e2fb4b" />
-    <!-- Number of KeyIDs = 1 -->
-    <BS bits="32" value="1" />
-    <!-- KeyID -->
-    <BS ID128="0x7e571d037e571d037e571d037e571d03" />
-  </DRMInfo>
-
-  <CrypTrack trackID="1" isEncrypted="1" IV_size="16" saiSavedBox="senc"
-    first_IV="0x00000000000000000000000000000000">
-    <key KID="0x7e571d037e571d037e571d037e571d03"
-      value="0x7e5733337e5733337e5733337e573333" />
-  </CrypTrack>
-
-</GPACDRM>
--- a/dom/media/test/eme.js
+++ b/dom/media/test/eme.js
@@ -29,24 +29,16 @@ function StringToArrayBuffer(str)
   var arr = new ArrayBuffer(str.length);
   var view = new Uint8Array(arr);
   for (var i = 0; i < str.length; i++) {
     view[i] = str.charCodeAt(i);
   }
   return arr;
 }
 
-function StringToHex(str){
-  var res = "";
-  for (var i = 0; i < str.length; ++i) {
-      res += ("0" + str.charCodeAt(i).toString(16)).slice(-2);
-  }
-  return res;
-}
-
 function Base64ToHex(str)
 {
   var bin = window.atob(str.replace(/-/g, "+").replace(/_/g, "/"));
   var res = "";
   for (var i = 0; i < bin.length; i++) {
     res += ("0" + bin.charCodeAt(i).toString(16)).substr(-2);
   }
   return res;
@@ -92,18 +84,21 @@ function TimeRangesToString(trs)
     if (++i === l) { return s; }
     s += ",";
   }
 }
 
 function SourceBufferToString(sb)
 {
   return ("SourceBuffer{"
-    + (sb.updating ? "updating, " : "")
-    + "buffered=" + TimeRangesToString(sb.buffered)
+    + "AppendMode=" + (sb.AppendMode || "-")
+    + ", updating=" + (sb.updating ? "true" : "false")
+    + ", buffered=" + TimeRangesToString(sb.buffered)
+    + ", audioTracks=" + (sb.audioTracks ? sb.audioTracks.length : "-")
+    + ", videoTracks=" + (sb.videoTracks ? sb.videoTracks.length : "-")
     + "}");
 }
 
 function SourceBufferListToString(sbl)
 {
   return "SourceBufferList[" + sbl.map(SourceBufferToString).join(", ") + "]";
 }
 
@@ -307,17 +302,18 @@ function PlayMultiTrack(test, elem, toke
         ms.endOfStream();
         resolve();
       });
     })
   });
 }
 
 // Returns a promise that is resolved when the media element is ready to have
-// its play() function called; when it's loaded MSE fragments.
+// its play() function called; when it's loaded MSE fragments, or once the load
+// has started for non-MSE video.
 function LoadTest(test, elem, token)
 {
   if (test.fragments) {
     // A |fragments| array indicates that this is an MSE test case with one track.
     return PlayFragmented(test, elem, token);
   }
 
   if (test.tracks) {
@@ -348,108 +344,81 @@ function SetupEME(test, token, params)
 
   // Finish the test when error is encountered.
   v.onerror = bail(token + " got error event");
 
   var onSetKeysFail = (params && params.onSetKeysFail)
     ? params.onSetKeysFail
     : bail(token + " Failed to set MediaKeys on <video> element");
 
-  // null: No session management in progress, just go ahead and update the session.
-  // [...]: Session management in progress, add [initDataType, initData] to
-  //        this queue to get it processed when possible.
-  var initDataQueue = [];
-  function processInitDataQueue()
-  {
-    if (initDataQueue === null) { return; }
-    if (initDataQueue.length === 0) { initDataQueue = null; return; }
-    var ev = initDataQueue.shift();
+  var firstEncrypted = true;
+
+  v.addEventListener("encrypted", function(ev) {
+    if (!firstEncrypted) {
+      // TODO: Better way to handle 'encrypted'?
+      //       Maybe wait for metadataloaded and all expected 'encrypted's?
+      Log(token, "got encrypted event again, initDataType=" + ev.initDataType);
+      return;
+    }
+    firstEncrypted = false;
 
-    var sessionType = (params && params.sessionType) ? params.sessionType : "temporary";
-    Log(token, "createSession(" + sessionType + ") for (" + ev.initDataType + ", " + StringToHex(ArrayBufferToString(ev.initData)) + ")");
-    var session = v.mediaKeys.createSession(sessionType);
-    if (params && params.onsessioncreated) {
-      params.onsessioncreated(session);
+    Log(token, "got encrypted event, initDataType=" + ev.initDataType);
+    var options = [
+      {
+        initDataType: ev.initDataType,
+        videoType: test.type,
+        audioType: test.type,
+      }
+    ];
+
+    function chain(promise, onReject) {
+      return promise.then(function(value) {
+        return Promise.resolve(value);
+      }).catch(function(reason) {
+        onReject(reason);
+        return Promise.reject();
+      })
     }
 
-    return new Promise(function (resolve, reject) {
-      session.addEventListener("message", UpdateSessionFunc(test, token, sessionType, resolve, reject));
-      Log(token, "session.generateRequest(" + ev.initDataType + ", " + StringToHex(ArrayBufferToString(ev.initData)) + ")");
-      session.generateRequest(ev.initDataType, ev.initData).catch(function(reason) {
-        // Reject the promise if generateRequest() failed. Otherwise it will
-        // be resolve in UpdateSessionFunc().
-        bail(token + ": session.generateRequest(" + ev.initDataType + ", " + StringToHex(ArrayBufferToString(ev.initData)) + ") failed")(reason);
-        reject();
+    var p = navigator.requestMediaKeySystemAccess(KEYSYSTEM_TYPE, options);
+    var r = bail(token + " Failed to request key system access.");
+    chain(p, r)
+    .then(function(keySystemAccess) {
+      var p = keySystemAccess.createMediaKeys();
+      var r = bail(token +  " Failed to create MediaKeys object");
+      return chain(p, r);
+    })
+
+    .then(function(mediaKeys) {
+      Log(token, "created MediaKeys object ok");
+      mediaKeys.sessions = [];
+      var p = v.setMediaKeys(mediaKeys);
+      return chain(p, onSetKeysFail);
+    })
+
+    .then(function() {
+      Log(token, "set MediaKeys on <video> element ok");
+      var sessionType = (params && params.sessionType) ? params.sessionType : "temporary";
+      var session = v.mediaKeys.createSession(sessionType);
+      if (params && params.onsessioncreated) {
+        params.onsessioncreated(session);
+      }
+
+      return new Promise(function (resolve, reject) {
+        session.addEventListener("message", UpdateSessionFunc(test, token, sessionType, resolve, reject));
+        session.generateRequest(ev.initDataType, ev.initData).catch(function(reason) {
+          // Reject the promise if generateRequest() failed. Otherwise it will
+          // be resolve in UpdateSessionFunc().
+          bail(token + ": session.generateRequest failed")(reason);
+          reject();
+        });
       });
     })
 
-    .then(function(aSession) {
-      Log(token, "session.generateRequest(" + ev.initDataType + ", " + StringToHex(ArrayBufferToString(ev.initData)) + ") succeeded");
+    .then(function(session) {
+      Log(token, ": session.generateRequest succeeded");
       if (params && params.onsessionupdated) {
-        params.onsessionupdated(aSession);
-      }
-      processInitDataQueue();
-    });
-  }
-
-  // All 'initDataType's should be the same.
-  // null indicates no 'encrypted' event received yet.
-  var initDataType = null;
-  v.addEventListener("encrypted", function(ev) {
-    if (initDataType === null) {
-      Log(token, "got first encrypted(" + ev.initDataType + ", " + StringToHex(ArrayBufferToString(ev.initData)) + "), setup session");
-      initDataType = ev.initDataType;
-      initDataQueue.push(ev);
-
-      function chain(promise, onReject) {
-        return promise.then(function(value) {
-          return Promise.resolve(value);
-        }).catch(function(reason) {
-          onReject(reason);
-          return Promise.reject();
-        })
+        params.onsessionupdated(session);
       }
-
-      var options = [
-         {
-           initDataType: ev.initDataType,
-           videoType: test.type,
-           audioType: test.type,
-         }
-       ];
-      var p = navigator.requestMediaKeySystemAccess(KEYSYSTEM_TYPE, options);
-      var r = bail(token + " Failed to request key system access.");
-      chain(p, r)
-      .then(function(keySystemAccess) {
-        var p = keySystemAccess.createMediaKeys();
-        var r = bail(token +  " Failed to create MediaKeys object");
-        return chain(p, r);
-      })
-
-      .then(function(mediaKeys) {
-        Log(token, "created MediaKeys object ok");
-        mediaKeys.sessions = [];
-        var p = v.setMediaKeys(mediaKeys);
-        return chain(p, onSetKeysFail);
-      })
-
-      .then(function() {
-        Log(token, "set MediaKeys on <video> element ok");
-        processInitDataQueue();
-      })
-    } else {
-      if (ev.initDataType !== initDataType) {
-        return bail(token + ": encrypted(" + ev.initDataType + ", " +
-                    StringToHex(ArrayBufferToString(ev.initData)) + ")")
-                   ("expected " + initDataType);
-      }
-      if (initDataQueue !== null) {
-        Log(token, "got encrypted(" + ev.initDataType + ", " + StringToHex(ArrayBufferToString(ev.initData)) + ") event, queue it for later session update");
-        initDataQueue.push(ev);
-      } else {
-        Log(token, "got encrypted(" + ev.initDataType + ", " + StringToHex(ArrayBufferToString(ev.initData)) + ") event, update session now");
-        initDataQueue = [ev];
-        processInitDataQueue();
-      }
-    }
+    });
   });
   return v;
 }
--- a/dom/media/test/manifest.js
+++ b/dom/media/test/manifest.js
@@ -642,50 +642,48 @@ var gMetadataTests = [
   },
   { name:"wavedata_u8.wav", tags: { }
   },
 ];
 
 // Test files for Encrypted Media Extensions
 var gEMETests = [
   {
-    name:"video-only with 2 keys",
+    name:"bipbop-cenc-videoinit.mp4",
     type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"",
     fragments:[ "bipbop-cenc-videoinit.mp4",
                 "bipbop-cenc-video1.m4s",
                 "bipbop-cenc-video2.m4s",
               ],
     keys: {
       // "keyid" : "key"
       "7e571d037e571d037e571d037e571d03" : "7e5733337e5733337e5733337e573333",
       "7e571d047e571d047e571d047e571d04" : "7e5744447e5744447e5744447e574444",
     },
     sessionType:"temporary",
-    sessions:1,
     duration:1.60,
   },
   {
-    name:"video-only with 2 keys, CORS",
+    name:"bipbop-cenc-videoinit.mp4",
     type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"",
     fragments:[ "bipbop-cenc-videoinit.mp4",
                 "bipbop-cenc-video1.m4s",
                 "bipbop-cenc-video2.m4s",
               ],
     keys: {
       // "keyid" : "key"
       "7e571d037e571d037e571d037e571d03" : "7e5733337e5733337e5733337e573333",
       "7e571d047e571d047e571d047e571d04" : "7e5744447e5744447e5744447e574444",
     },
     sessionType:"temporary",
-    sessions:1,
     crossOrigin:true,
     duration:1.60,
   },
   {
-    name:"audio&video tracks, both with all keys",
+    name:"bipbop-cenc-videoinit.mp4",
     type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"",
     tracks: [
       {
         name:"audio",
         type:"audio/mp4; codecs=\"mp4a.40.2\"",
         fragments:[ "bipbop-cenc-audioinit.mp4",
                     "bipbop-cenc-audio1.m4s",
                     "bipbop-cenc-audio2.m4s",
@@ -702,21 +700,20 @@ var gEMETests = [
       },
     ],
     keys: {
       // "keyid" : "key"
       "7e571d037e571d037e571d037e571d03" : "7e5733337e5733337e5733337e573333",
       "7e571d047e571d047e571d047e571d04" : "7e5744447e5744447e5744447e574444",
     },
     sessionType:"temporary",
-    sessions:2,
     duration:1.60,
   },
   {
-    name:"audio&video tracks, both with all keys, CORS",
+    name:"bipbop-cenc-videoinit.mp4",
     type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"",
     tracks: [
       {
         name:"audio",
         type:"audio/mp4; codecs=\"mp4a.40.2\"",
         fragments:[ "bipbop-cenc-audioinit.mp4",
                     "bipbop-cenc-audio1.m4s",
                     "bipbop-cenc-audio2.m4s",
@@ -733,51 +730,19 @@ var gEMETests = [
       },
     ],
     keys: {
       // "keyid" : "key"
       "7e571d037e571d037e571d037e571d03" : "7e5733337e5733337e5733337e573333",
       "7e571d047e571d047e571d047e571d04" : "7e5744447e5744447e5744447e574444",
     },
     sessionType:"temporary",
-    sessions:2,
     crossOrigin:true,
     duration:1.60,
   },
-  {
-    name:"audio&video tracks, each with its key",
-    type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"",
-    tracks: [
-      {
-        name:"audio",
-        type:"audio/mp4; codecs=\"mp4a.40.2\"",
-        fragments:[ "bipbop-cenc1-audioinit.mp4",
-                    "bipbop-cenc1-audio1.m4s",
-                    "bipbop-cenc1-audio2.m4s",
-                    "bipbop-cenc1-audio3.m4s",
-                  ],
-      },
-      {
-        name:"video",
-        type:"video/mp4; codecs=\"avc1.64000d\"",
-        fragments:[ "bipbop-cenc1-videoinit.mp4",
-                    "bipbop-cenc1-video1.m4s",
-                    "bipbop-cenc1-video2.m4s",
-                  ],
-      },
-    ],
-    keys: {
-      // "keyid" : "key"
-      "7e571d037e571d037e571d037e571d03" : "7e5733337e5733337e5733337e573333",
-      "7e571d047e571d047e571d047e571d04" : "7e5744447e5744447e5744447e574444",
-    },
-    sessionType:"temporary",
-    sessions:2,
-    duration:1.60,
-  },
 ];
 
 var gEMENonMSEFailTests = [
   {
     name:"short-cenc.mp4",
     type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"",
     duration:0.47,
   },
--- a/dom/media/test/mochitest.ini
+++ b/dom/media/test/mochitest.ini
@@ -47,23 +47,16 @@ support-files =
   big.wav^headers^
   bipbop-cenc-audio1.m4s
   bipbop-cenc-audio2.m4s
   bipbop-cenc-audio3.m4s
   bipbop-cenc-audioinit.mp4
   bipbop-cenc-video1.m4s
   bipbop-cenc-video2.m4s
   bipbop-cenc-videoinit.mp4
-  bipbop-cenc1-audio1.m4s
-  bipbop-cenc1-audio2.m4s
-  bipbop-cenc1-audio3.m4s
-  bipbop-cenc1-audioinit.mp4
-  bipbop-cenc1-video1.m4s
-  bipbop-cenc1-video2.m4s
-  bipbop-cenc1-videoinit.mp4
   bogus.duh
   bogus.ogv
   bogus.ogv^headers^
   bogus.wav
   bogus.wav^headers^
   bug461281.ogg
   bug461281.ogg^headers^
   bug482461-theora.ogv
--- a/dom/media/test/test_eme_canvas_blocked.html
+++ b/dom/media/test/test_eme_canvas_blocked.html
@@ -33,20 +33,17 @@ function startTest(test, token)
       ctx.drawImage(video, 0, 0);
     } catch (ex) {
       threwError = true;
     }
     ok(threwError, TimeStamp(token) + " - Should throw an error when trying to draw EME video to canvas.");
     manager.finished(token);
   });
 
-  manager.started(token + "_load");
-  LoadTest(test, v, token)
-  .then(function() { manager.finished(token + "_load"); })
-  .catch(function() { manager.finished(token + "_load"); });
+  LoadTest(test, v, token);
 }
 
 function beginTest() {
   manager.runTests(gEMETests, startTest);
 }
 
 var prefs = [
   [ "media.mediasource.enabled", true ],
--- a/dom/media/test/test_eme_obs_notification.html
+++ b/dom/media/test/test_eme_obs_notification.html
@@ -47,20 +47,17 @@ function startTest(test, token)
   v.preload = "auto"; // Required due to "canplay" not firing for MSE unless we do this.
 
   v.addEventListener("loadeddata", function(ev) {
     ok(observedVideos.has(ev.target), "Should have been told about eme video through observer as well.");
     observedVideos.delete(ev.target);
     manager.finished(token);
   });
 
-  manager.started(token + "_load");
-  LoadTest(test, v, token)
-  .then(function() { manager.finished(token + "_load"); })
-  .catch(function() { manager.finished(token + "_load"); });
+  LoadTest(test, v, token);
 }
 
 function beginTest() {
   manager.runTests(gEMETests, startTest);
 }
 
 var prefs = [
   [ "media.mediasource.enabled", true ],
--- a/dom/media/test/test_eme_persistent_sessions.html
+++ b/dom/media/test/test_eme_persistent_sessions.html
@@ -69,16 +69,17 @@ function startTest(test, token)
 
   var keySystemAccess;
 
   var v = SetupEME(test, token,
     {
       onsessionupdated: function(session) {
         Log(token, "Session created");
         var sessionId;
+        initialSession = session;
 
         // Once the session has loaded and has all its keys usable, close
         // all sessions without calling remove() on them.
         AwaitAllKeysUsable(session, test.keys, token)
         .then(function() {
           sessionId = session.sessionId;
           Log(token, "Closing session with id=" + sessionId);
           return session.close();
@@ -141,24 +142,21 @@ function startTest(test, token)
           manager.finished(token);
         });
 
       },
       sessionType: "persistent",
     }
   );
 
-  manager.started(token + "_load");
-  LoadTest(test, v, token)
-  .then(function() { manager.finished(token + "_load"); })
-  .catch(function() { manager.finished(token + "_load"); });
+  LoadTest(test, v, token);
 }
 
 function beginTest() {
-  manager.runTests(gEMETests.filter(t => t.sessions === 1), startTest);
+  manager.runTests(gEMETests, startTest);
 }
 
 var prefs = [
   [ "media.mediasource.enabled", true ],
   [ "media.mediasource.mp4.enabled", true ],
 ];
 
 if (/Linux/.test(navigator.userAgent) ||
--- a/dom/media/test/test_eme_playback.html
+++ b/dom/media/test/test_eme_playback.html
@@ -69,32 +69,26 @@ function startTest(test, token)
     ok(gotEncrypted, TimeStamp(token) + " encrypted event should have fired");
     ok(gotPlaying, TimeStamp(token) + " playing event should have fired");
 
     ok(Math.abs(test.duration - v.duration) < 0.1,
        TimeStamp(token) + " Duration of video should be corrrect");
     ok(Math.abs(test.duration - v.currentTime) < 0.1,
        TimeStamp(token) + " Current time should be same as duration");
 
-    // Verify all sessions had all keys went sent to the CDM usable, and thus
+    // Verify all sessions had all keys went sent the to the CDM usable, and thus
     // that we received keystatuseschange event(s).
-    is(sessions.length, test.sessions, TimeStamp(token) + " should have " + test.sessions + " session" + (test.sessions===1?"":"s"));
-    var keyIdsReceived = [];
-    for (var keyid in test.keys) { keyIdsReceived[keyid] = false; }
+    is(sessions.length, 1, TimeStamp(token) + " should have 1 session");
     for (var i = 0; i < sessions.length; i++) {
       var session = sessions[i];
       ok(session.gotKeysChanged, TimeStamp(token) + " should have received at least one keychange event");
       for (var kid in session.keyIdsReceived) {
-        Log(token, "session " + i + " key " + kid + " = " + (session.keyIdsReceived[kid] ? "true" : "false"));
-        if (session.keyIdsReceived[kid]) { keyIdsReceived[kid] = true; }
+        ok(session.keyIdsReceived[kid], TimeStamp(token) + " key with id " + kid + " was usable as expected");
       }
     }
-    for (var kid in keyIdsReceived) {
-      ok(keyIdsReceived[kid], TimeStamp(token) + " key with id " + kid + " was usable as expected");
-    }
 
     manager.finished(token);
   });
 
   LoadTest(test, v, token)
   .then(function() {
     v.play();
   }).catch(function() {
--- a/dom/media/test/test_eme_stream_capture_blocked.html
+++ b/dom/media/test/test_eme_stream_capture_blocked.html
@@ -27,20 +27,17 @@ function startTest(test, token)
   };
   var v1 = SetupEME(test, case1token,  { onSetKeysFail: setKeysFailed });
   var context = new AudioContext();
   var node = context.createMediaElementSource(v1);
   v1.addEventListener("loadeddata", function(ev) {
     ok(false, TimeStamp(case1token) + " should never reach loadeddata, as setMediaKeys should fail");
   });
   manager.started(case1token);
-  manager.started(case1token + "_load");
-  LoadTest(test, v1, case1token)
-  .then(function() { manager.finished(case1token + "_load" ); })
-  .catch(function() { manager.finished(case1token + "_load" ); });
+  LoadTest(test, v1, case1token);
 
 
   // Case 2. creating a MediaElementSource on a media element with a MediaKeys should fail.
   var case2token = token + "_case2";
   var v2 = SetupEME(test, case2token);
   v2.addEventListener("loadeddata", function(ev) {
     ok(true, case2token + " should reach loadeddata");
     var threw = false;
@@ -49,20 +46,17 @@ function startTest(test, token)
       var node = context.createMediaElementSource(v2);
     } catch (e) {
       threw = true;
     }
     ok(threw, "Should throw an error creating a MediaElementSource on an EME video.");
     manager.finished(case2token);
   });
   manager.started(case2token);
-  manager.started(case2token + "_load");
-  LoadTest(test, v2, case2token)
-  .then(function() { manager.finished(case2token + "_load" ); })
-  .catch(function() { manager.finished(case2token + "_load" ); });
+  LoadTest(test, v2, case2token);
 
 
   // Case 3. capturing a media element with mozCaptureStream that has a MediaKeys should fail.
   var case3token = token + "_case3";
   var v3 = SetupEME(test, case3token);
   v3.addEventListener("loadeddata", function(ev) {
     ok(true, TimeStamp(case3token) + " should reach loadeddata");
     var threw = false;
@@ -70,20 +64,17 @@ function startTest(test, token)
       var stream = v3.mozCaptureStreamUntilEnded();
     } catch (e) {
       threw = true;
     }
     ok(threw, TimeStamp(case3token) + " Should throw an error calling mozCaptureStreamUntilEnded an EME video.");
     manager.finished(case3token);
   });
   manager.started(case3token);
-  manager.started(case3token + "_load");
-  LoadTest(test, v3, case3token)
-  .then(function() { manager.finished(case3token + "_load" ); })
-  .catch(function() { manager.finished(case3token + "_load" ); });
+  LoadTest(test, v3, case3token);
 }
 
 function beginTest() {
   manager.runTests(gEMETests, startTest);
 }
 
 var prefs = [
   [ "media.mediasource.enabled", true ],