Backed out changeset 1a73ee138e23 (bug 1278198)
authorIris Hsiao <ihsiao@mozilla.com>
Fri, 22 Jul 2016 12:05:47 +0800
changeset 346153 96b0bce9b8f2803f73c39c13b29546fa2709f2b9
parent 346152 5119005846f3174268ac385cdcbc0d57ad1ed151
child 346154 d00d42fc13d84dfb71a336ed77cc0ab35fc65403
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1278198
milestone50.0a1
backs out1a73ee138e2322740f4099817434f162ac004313
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 1a73ee138e23 (bug 1278198)
dom/media/test/eme.js
dom/media/test/test_eme_detach_media_keys.html
dom/media/test/test_eme_initDataTypes.html
dom/media/test/test_eme_non_mse_fails.html
dom/media/test/test_eme_persistent_sessions.html
dom/media/test/test_eme_requestKeySystemAccess.html
dom/media/test/test_eme_request_notifications.html
dom/media/test/test_eme_session_callable_value.html
dom/media/test/test_eme_setMediaKeys_before_attach_MediaSource.html
--- a/dom/media/test/eme.js
+++ b/dom/media/test/eme.js
@@ -1,15 +1,9 @@
-const CLEARKEY_KEYSYSTEM = "org.w3.clearkey";
-
-const gCencMediaKeySystemConfig = [{
-  initDataTypes: ['cenc'],
-  videoCapabilities: [{ contentType: 'video/mp4' }],
-  audioCapabilities: [{ contentType: 'audio/mp4' }],
-}];
+const KEYSYSTEM_TYPE = "org.w3.clearkey";
 
 function IsMacOSSnowLeopardOrEarlier() {
   var re = /Mac OS X (\d+)\.(\d+)/;
   var ver = navigator.userAgent.match(re);
   if (!ver || ver.length != 3) {
     return false;
   }
   var major = ver[1] | 0;
@@ -377,17 +371,17 @@ function SetupEME(test, token, params)
       var options = { initDataTypes: [ev.initDataType] };
       if (streamType("video")) {
         options.videoCapabilities = [{contentType: streamType("video")}];
       }
       if (streamType("audio")) {
         options.audioCapabilities = [{contentType: streamType("audio")}];
       }
 
-      var p = navigator.requestMediaKeySystemAccess(CLEARKEY_KEYSYSTEM, [options]);
+      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);
       })
 
--- a/dom/media/test/test_eme_detach_media_keys.html
+++ b/dom/media/test/test_eme_detach_media_keys.html
@@ -9,28 +9,28 @@
 </head>
 <body>
 <pre id="test">
 <video id="v" controls></video>
 <script class="testbody" type="text/javascript">
 
 SimpleTest.waitForExplicitFinish();
 
+const keysystem = 'org.w3.clearkey';
+
 function createAndSet() {
   return new Promise(function(resolve, reject) {
     var m;
-    navigator.requestMediaKeySystemAccess(CLEARKEY_KEYSYSTEM, gCencMediaKeySystemConfig)
+    navigator.requestMediaKeySystemAccess(keysystem, [{initDataTypes: ['cenc']}])
     .then(function (access) {
       return access.createMediaKeys();
-    })
-    .then(function (mediaKeys) {
+    }).then(function (mediaKeys) {
       m = mediaKeys;
       return document.getElementById("v").setMediaKeys(mediaKeys);
-    })
-    .then(function() {
+    }).then(function() {
       resolve(m);
     });
   }
 )}
 
 var m1,m2;
 
 // Test that if we create and set two MediaKeys on one video element,
--- a/dom/media/test/test_eme_initDataTypes.html
+++ b/dom/media/test/test_eme_initDataTypes.html
@@ -34,19 +34,19 @@ var tests = [
     initData: '{"type":"temporary", "kids":["LwVHf8JLtPrv2GUXFW2v_A", "0DdtU9od-Bh5L3xbv0Xf_A"]}',
     expectedRequest: '{"kids":["LwVHf8JLtPrv2GUXFW2v_A","0DdtU9od-Bh5L3xbv0Xf_A"],"type":"temporary"}',
     sessionType: 'temporary',
     expectPass: true,
   },
   {
     name: "Two keyIds, persistent session, type before kids",
     initDataType: 'keyids',
-    initData: '{"type":"persistent-license", "kids":["LwVHf8JLtPrv2GUXFW2v_A", "0DdtU9od-Bh5L3xbv0Xf_A"]}',
-    expectedRequest: '{"kids":["LwVHf8JLtPrv2GUXFW2v_A","0DdtU9od-Bh5L3xbv0Xf_A"],"type":"persistent-license"}',
-    sessionType: 'persistent-license',
+    initData: '{"type":"persistent", "kids":["LwVHf8JLtPrv2GUXFW2v_A", "0DdtU9od-Bh5L3xbv0Xf_A"]}',
+    expectedRequest: '{"kids":["LwVHf8JLtPrv2GUXFW2v_A","0DdtU9od-Bh5L3xbv0Xf_A"],"type":"persistent"}',
+    sessionType: 'persistent',
     expectPass: true,
   },
   {
     name: "Invalid keyId",
     initDataType: 'keyids',
     initData: '{"kids":["0"]}',
     sessionType: 'temporary',
     expectPass: false,
@@ -57,17 +57,17 @@ var tests = [
     initData: '{"kids":[""]}',
     sessionType: 'temporary',
     expectPass: false,
   },
   {
     name: "SessionType in license doesn't match MediaKeySession's sessionType",
     initDataType: 'keyids',
     initData: '{"kids":["LwVHf8JLtPrv2GUXFW2v_A"]}',
-    sessionType: 'persistent-license',
+    sessionType: 'persistent',
     expectPass: false,
   },
   {
     name: "One valid and one invalid kid",
     initDataType: 'keyids',
     initData: '{"kids":["LwVHf8JLtPrv2GUXFW2v_A", "invalid"]}',
     expectedRequest: '{"kids":["LwVHf8JLtPrv2GUXFW2v_A"],"type":"temporary"}',
     sessionType: 'temporary',
@@ -103,23 +103,20 @@ function PrepareInitData(initDataType, i
     return new TextEncoder().encode(initData);
   } else if (initDataType == "webm") {
     return StringToArrayBuffer(atob(initData));
   }
 }
 
 function Test(test) {
   return new Promise(function(resolve, reject) {
-    var configs = [{
-      initDataTypes: [test.initDataType],
-      videoCapabilities: [{contentType: 'video/mp4' }],
-    }];
-    navigator.requestMediaKeySystemAccess('org.w3.clearkey', configs)
-      .then((access) => access.createMediaKeys())
-      .then((mediaKeys) => {
+    navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{initDataTypes: [test.initDataType]}]).then(
+      (access) => access.createMediaKeys()
+      ).then(
+        (mediaKeys) => {
           var session = mediaKeys.createSession(test.sessionType);
           session.addEventListener("message", function(event) {
             is(event.messageType, "license-request", "'" + test.name + "' MediaKeyMessage type should be license-request.");
             var text = new TextDecoder().decode(event.message);
             is(text, test.expectedRequest, "'" + test.name + "' got expected response.");
             is(text == test.expectedRequest, test.expectPass,
                "'" + test.name + "' expected to " + (test.expectPass ? "pass" : "fail"));
             resolve();
--- a/dom/media/test/test_eme_non_mse_fails.html
+++ b/dom/media/test/test_eme_non_mse_fails.html
@@ -15,17 +15,17 @@ var manager = new MediaTestManager;
 function DoSetMediaKeys(v, test)
 {
   var options = [{
     initDataTypes: ["cenc"],
     audioCapabilities: [{contentType: test.audioType}],
     videoCapabilities: [{contentType: test.videoType}],
   }];
 
-  return navigator.requestMediaKeySystemAccess(CLEARKEY_KEYSYSTEM, options)
+  return navigator.requestMediaKeySystemAccess("org.w3.clearkey", options)
 
   .then(function(keySystemAccess) {
     return keySystemAccess.createMediaKeys();
   })
 
   .catch(function() {
     ok(false, token + " was not expecting failure (yet)");
   })
--- a/dom/media/test/test_eme_persistent_sessions.html
+++ b/dom/media/test/test_eme_persistent_sessions.html
@@ -81,27 +81,27 @@ function startTest(test, token)
         .then(function() {
           sessionId = session.sessionId;
           Log(token, "Closing session with id=" + sessionId);
           return session.close();
         })
 
         // Once the session is closed, reload the MediaKeys and reload the session
         .then(function() {
-          return navigator.requestMediaKeySystemAccess(CLEARKEY_KEYSYSTEM, gCencMediaKeySystemConfig);
+          return navigator.requestMediaKeySystemAccess(KEYSYSTEM_TYPE, [{initDataTypes:["cenc"]}]);
         })
 
         .then(function(requestedKeySystemAccess) {
           keySystemAccess = requestedKeySystemAccess;
           return keySystemAccess.createMediaKeys();
         })
 
         .then(function(mediaKeys) {
           Log(token, "re-created MediaKeys object ok");
-          recreatedSession = mediaKeys.createSession("persistent-license");
+          recreatedSession = mediaKeys.createSession("persistent");
           Log(token, "Created recreatedSession, loading sessionId=" + sessionId);
           return recreatedSession.load(sessionId);
         })
 
         .then(function(suceeded) {
           if (suceeded) {
             return Promise.resolve();
           } else {
@@ -122,32 +122,32 @@ function startTest(test, token)
           Log(token, "removed session, all keys unusable.");
           // Attempt to recreate the session, the attempt should fail.
           return keySystemAccess.createMediaKeys();
         })
 
         .then(function(mediaKeys) {
           Log(token, "re-re-created MediaKeys object ok");
           // Trying to load the removed persistent session should fail.
-          return mediaKeys.createSession("persistent-license").load(sessionId);
+          return mediaKeys.createSession("persistent").load(sessionId);
         })
 
         .then(function(suceeded) {
           is(suceeded, false, token + " we expect the third session creation to fail, as the session should have been removed.");
           manager.finished(token);
         })
 
         .catch(function(reason) {
           // Catch rejections if any.
           ok(false, token + " rejected, reason=" + reason);
           manager.finished(token);
         });
 
       },
-      sessionType: "persistent-license",
+      sessionType: "persistent",
     }
   );
 
   LoadTestWithManagedLoadToken(test, v, manager, token,
                                { onlyLoadFirstFragments:2, noEndOfStream:false });
 }
 
 function beginTest() {
--- a/dom/media/test/test_eme_requestKeySystemAccess.html
+++ b/dom/media/test/test_eme_requestKeySystemAccess.html
@@ -6,16 +6,17 @@
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
   <script type="text/javascript" src="manifest.js"></script>
   <script type="text/javascript" src="eme.js"></script>
 </head>
 <body>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
+const CLEARKEY_ID = 'org.w3.clearkey';
 const SUPPORTED_LABEL = "pass label";
 
 function ValidateConfig(name, expected, observed) {
   info("ValidateConfig " + name);
   info("expected cfg=" + JSON.stringify(expected));
   info("observed cfg=" + JSON.stringify(observed));
 
   is(observed.label, expected.label, name + " label should match");
@@ -30,38 +31,31 @@ function ValidateConfig(name, expected, 
   }
   if (typeof expected.videoCapabilities !== 'undefined') {
     info("expected.videoCapabilities=" + expected.videoCapabilities);
     dump("expected.videoCapabilities=" + expected.videoCapabilities + "\n");
     ok(expected.videoCapabilities.length == 1, "Test function can only handle one capability.");
     ok(observed.videoCapabilities.length == 1, "Test function can only handle one capability.");
     is(observed.videoCapabilities[0].contentType, expected.videoCapabilities[0].contentType, name + " videoCapabilities should match.");
   }
-  if (expected.sessionTypes) {
-    is(expected.sessionTypes.length, observed.sessionTypes.length, "Should have expected number of sessionTypes");
-    for (var i = 0; i < expected.sessionTypes.length; i++) {
-      is(expected[i], observed[i], "Session type " + i + " should match");
-    }
-  }
 }
 
 function Test(test) {
   var name = "'" + test.name + "'";
   return new Promise(function(resolve, reject) {
     var p;
     if (test.options) {
-      var keySystem = (test.keySystem !== undefined) ? test.keySystem : CLEARKEY_KEYSYSTEM;
-      p = navigator.requestMediaKeySystemAccess(keySystem, test.options);
+      p = navigator.requestMediaKeySystemAccess(test.keySystem, test.options);
     } else {
-      p = navigator.requestMediaKeySystemAccess(keySystem);
+      p = navigator.requestMediaKeySystemAccess(test.keySystem);
     }
     p.then(
       function(keySystemAccess) {
         ok(test.shouldPass, name + " passed and was expected to " + (test.shouldPass ? "pass" : "fail"));
-        is(keySystemAccess.keySystem, CLEARKEY_KEYSYSTEM, "CDM keySystem should be in MediaKeySystemAccess.keySystem");
+        is(keySystemAccess.keySystem, CLEARKEY_ID, "CDM keySystem should be in MediaKeySystemAccess.keySystem");
         ValidateConfig(name, test.expectedConfig, keySystemAccess.getConfiguration());
         resolve();
       },
       function(ex) {
         if (test.shouldPass) {
           info(name + " failed: " + ex);
         }
         ok(!test.shouldPass, name + " failed and was expected to " + (test.shouldPass ? "pass" : "fail"));
@@ -79,37 +73,38 @@ var tests = [
         initDataTypes: ['cenc'],
         videoCapabilities: [{contentType: 'video/mp4'}],
       }
     ],
     shouldPass: false,
   },
   {
     name: 'Empty options specified',
+    keySystem: CLEARKEY_ID,
     options: [ ],
     shouldPass: false,
   },
   {
     name: 'Undefined options',
+    keySystem: CLEARKEY_ID,
     shouldPass: false,
   },
   {
     name: 'Basic MP4 cenc',
+    keySystem: CLEARKEY_ID,
     options: [
       {
         label: SUPPORTED_LABEL,
         initDataTypes: ['cenc'],
-        audioCapabilities: [{contentType: 'audio/mp4'}],
         videoCapabilities: [{contentType: 'video/mp4'}],
       }
     ],
     expectedConfig: {
       label: SUPPORTED_LABEL,
       initDataTypes: ['cenc'],
-      audioCapabilities: [{contentType: 'audio/mp4'}],
       videoCapabilities: [{contentType: 'video/mp4'}],
     },
     shouldPass: true,
   },
   {
     name: 'Invalid keysystem failure',
     keySystem: 'bogusKeySystem',
     options: [
@@ -117,113 +112,134 @@ var tests = [
         initDataTypes: ['cenc'],
         videoCapabilities: [{contentType: 'video/mp4'}],
       }
     ],
     shouldPass: false,
   },
   {
     name: 'Invalid initDataType',
+    keySystem: CLEARKEY_ID,
     options: [
       {
         initDataTypes: ['bogus'],
-        audioCapabilities: [{contentType: 'audio/mp4'}],
       }
     ],
     shouldPass: false,
   },
   {
     name: 'Valid initDataType after invalid',
+    keySystem: CLEARKEY_ID,
     options: [
       {
         label: SUPPORTED_LABEL,
         initDataTypes: ['bogus', 'invalid', 'cenc'],
-        audioCapabilities: [{contentType: 'audio/mp4'}],
       }
     ],
     expectedConfig: {
       label: SUPPORTED_LABEL,
       initDataTypes: ['cenc'],
-      audioCapabilities: [{contentType: 'audio/mp4'}],
     },
     shouldPass: true,
   },
   {
+    name: 'Empty initDataTypes',
+    keySystem: CLEARKEY_ID,
+    options: [
+      {
+        initDataTypes: [],
+      }
+    ],
+    shouldPass: false,
+  },
+  {
     name: 'Invalid videoType',
+    keySystem: CLEARKEY_ID,
     options: [
       {
         initDataTypes: ['cenc'],
         videoCapabilities: [{contentType: 'video/bogus'}],
       }
     ],
     shouldPass: false,
   },
   {
-    name: 'Invalid distinctiveIdentifier fails',
-    options: [
-      {
-        initDataTypes: ['cenc'],
-        videoCapabilities: [{contentType: 'video/mp4'}],
-        distinctiveIdentifier: 'bogus',
-        persistentState: 'bogus',
-      }
-    ],
-    shouldPass: false,
-  },
-  {
-    name: 'distinctiveIdentifier is prohibited for ClearKey',
-    options: [
-      {
-        initDataTypes: ['cenc'],
-        videoCapabilities: [{contentType: 'video/mp4'}],
-        distinctiveIdentifier: 'required',
-      }
-    ],
-    shouldPass: false,
-  },
-  {
-    name: 'Invalid persistentState fails',
-    options: [
-      {
-        initDataTypes: ['cenc'],
-        videoCapabilities: [{contentType: 'video/mp4'}],
-        persistentState: 'bogus',
-      }
-    ],
-    shouldPass: false,
-  },
-  {
-    name: 'Invalid robustness unsupported',
-    options: [
-      {
-        initDataTypes: ['cenc'],
-        videoCapabilities: [{contentType: 'video/mp4', robustness: 'very much so'}],
-      }
-    ],
-    shouldPass: false,
-  },
-  {
-    name: 'Unexpected config entry should be ignored',
+    name: 'distinctiveIdentifier, persistentState, and robustness ignored',
+    keySystem: CLEARKEY_ID,
     options: [
       {
         label: SUPPORTED_LABEL,
         initDataTypes: ['cenc'],
-        videoCapabilities: [{contentType: 'video/mp4'}],
-        unexpectedEntry: 'this should be ignored',
+        videoCapabilities: [{contentType: 'video/mp4', robustness: 'somewhat'}],
+        distinctiveIdentifier: 'bogus',
+        persistentState: 'bogus',
       }
     ],
     expectedConfig: {
       label: SUPPORTED_LABEL,
       initDataTypes: ['cenc'],
       videoCapabilities: [{contentType: 'video/mp4'}],
     },
     shouldPass: true,
   },
   {
+    name: 'Only unrecognised dict entries specified with unrecognised video type',
+    keySystem: CLEARKEY_ID,
+    options: [
+      {
+        videoCapabilities: [{robustness: 'very much so'}],
+        distinctiveIdentifier: 'required',
+        persistentState: 'required',
+      }
+    ],
+    shouldPass: false,
+  },
+  {
+    name: 'Only unrecognised dict entries specified should be ignored',
+    keySystem: CLEARKEY_ID,
+    options: [
+      {
+        label: SUPPORTED_LABEL,
+        distinctiveIdentifier: 'required',
+        persistentState: 'required',
+      }
+    ],
+    expectedConfig: {
+      label: SUPPORTED_LABEL,
+    },
+    shouldPass: true,
+  },
+  {
+    name: 'Empty config dict',
+    keySystem: CLEARKEY_ID,
+    options: [{ label: SUPPORTED_LABEL }],
+    expectedConfig: {
+      label: SUPPORTED_LABEL
+    },
+    shouldPass: true,
+  },
+  {
+    name: 'Unexpected config entry should be ignored',
+    keySystem: CLEARKEY_ID,
+    options: [
+      {
+        label: SUPPORTED_LABEL,
+        initDataTypes: ['cenc'],
+        unexpectedEntry: 'this should be ignored',
+      }
+    ],
+    expectedConfig: {
+      label: SUPPORTED_LABEL,
+      initDataTypes: ['cenc'],
+    },
+    shouldPass: true,
+  },
+  {
     name: 'Invalid option followed by valid',
+    keySystem: CLEARKEY_ID,
     options: [
       {
         label: "this config should not be supported",
         initDataTypes: ['bogus'],
       },
       {
         label: SUPPORTED_LABEL,
         initDataTypes: ['cenc'],
@@ -233,177 +249,135 @@ var tests = [
     expectedConfig: {
       label: SUPPORTED_LABEL,
       initDataTypes: ['cenc'],
       videoCapabilities: [{contentType: 'video/mp4'}],
     },
     shouldPass: true,
   },
   {
-    name: 'Persistent sessions; persistence required',
-    options: [
-      {
-        label: SUPPORTED_LABEL,
-        initDataTypes: ['cenc'],
-        videoCapabilities: [{contentType: 'video/mp4'}],
-        sessionTypes: ['temporary','persistent-license'],
-        persistentState: 'required',
-      }
-    ],
-    expectedConfig: {
-      label: SUPPORTED_LABEL,
-      initDataTypes: ['cenc'],
-      videoCapabilities: [{contentType: 'video/mp4'}],
-      sessionTypes: ['temporary','persistent-license'],
-      persistentState: 'required',
-    },
-    shouldPass: true,
-  },
-  {
-    name: 'Persistent sessions not allowed when persistentState prohibited',
-    options: [
-      {
-        initDataTypes: ['cenc'],
-        videoCapabilities: [{contentType: 'video/mp4'}],
-        sessionTypes: ['temporary','persistent-license'],
-        persistentState: 'not-allowed',
-      }
-    ],
-    shouldPass: false,
-  },
-  {
-    name: 'Persistent sessions; should bump optional persistState to required',
-    options: [
-      {
-        label: SUPPORTED_LABEL,
-        initDataTypes: ['cenc'],
-        videoCapabilities: [{contentType: 'video/mp4'}],
-        sessionTypes: ['temporary','persistent-license'],
-        persistentState: 'optional',
-      }
-    ],
-    expectedConfig: {
-      label: SUPPORTED_LABEL,
-      initDataTypes: ['cenc'],
-      videoCapabilities: [{contentType: 'video/mp4'}],
-      sessionTypes: ['temporary','persistent-license'],
-      persistentState: 'required',
-    },
-    shouldPass: true,
-  },
-  {
     name: 'MP4 audio container',
+    keySystem: CLEARKEY_ID,
     options: [
       {
         label: SUPPORTED_LABEL,
         initDataTypes: ['cenc'],
         audioCapabilities: [{contentType: 'audio/mp4'}],
       }
     ],
     expectedConfig: {
       label: SUPPORTED_LABEL,
       initDataTypes: ['cenc'],
       audioCapabilities: [{contentType: 'audio/mp4'}],
     },
     shouldPass: true,
   },
   {
     name: 'MP4 audio container with AAC-LC',
+    keySystem: CLEARKEY_ID,
     options: [
       {
         label: SUPPORTED_LABEL,
         initDataTypes: ['cenc'],
         audioCapabilities: [{contentType: 'audio/mp4; codecs="mp4a.40.2"'}],
       }
     ],
     expectedConfig: {
       label: SUPPORTED_LABEL,
       initDataTypes: ['cenc'],
       audioCapabilities: [{contentType: 'audio/mp4; codecs="mp4a.40.2"'}],
     },
     shouldPass: true,
   },
   {
     name: 'MP4 audio container with invalid codecs',
+    keySystem: CLEARKEY_ID,
     options: [
       {
         initDataTypes: ['cenc'],
         audioCapabilities: [{contentType: 'audio/mp4; codecs="bogus"'}],
       }
     ],
     shouldPass: false,
   },
   {
     name: 'MP4 audio container with mp3 is unsupported',
+    keySystem: CLEARKEY_ID,
     options: [
       {
         initDataTypes: ['cenc'],
         audioCapabilities: [{contentType: 'audio/mp4; codecs="mp3"'}],
       }
     ],
     shouldPass: false,
   },
   {
     name: 'MP4 video container type with an mp3 codec is unsupported',
+    keySystem: CLEARKEY_ID,
     options: [
       {
         initDataTypes: ['cenc'],
         videoCapabilities: [{contentType: 'video/mp4; codecs="mp3"'}],
       }
     ],
     shouldPass: false,
   },
   {
     name: 'MP4 audio container type with a video codec is unsupported',
+    keySystem: CLEARKEY_ID,
     options: [
       {
         initDataTypes: ['cenc'],
         audioCapabilities: [{contentType: 'audio/mp4; codecs="avc1.42E01E"'}],
       }
     ],
     shouldPass: false,
   },
   {
     name: 'MP4 video container with constrained baseline h.264',
+    keySystem: CLEARKEY_ID,
     options: [
       {
         label: SUPPORTED_LABEL,
         initDataTypes: ['cenc'],
         videoCapabilities: [{contentType: 'video/mp4; codecs="avc1.42E01E"'}],
       }
     ],
     expectedConfig: {
       label: SUPPORTED_LABEL,
       initDataTypes: ['cenc'],
       videoCapabilities: [{contentType: 'video/mp4; codecs="avc1.42E01E"'}],
     },
     shouldPass: true,
   },
   {
     name: 'MP4 video container with invalid codecs',
+    keySystem: CLEARKEY_ID,
     options: [
       {
         initDataTypes: ['cenc'],
         videoCapabilities: [{contentType: 'video/mp4; codecs="bogus"'}],
       }
     ],
     shouldPass: false,
   },
   {
     name: 'MP4 video container with both audio and video codec type in videoType',
+    keySystem: CLEARKEY_ID,
     options: [
       {
         initDataTypes: ['cenc'],
         videoCapabilities: [{contentType: 'video/mp4; codecs="avc1.42E01E,mp4a.40.2"'}],
       }
     ],
     shouldPass: false,
   },
   {
     name: 'MP4 audio and video type both specified',
+    keySystem: CLEARKEY_ID,
     options: [
       {
         label: SUPPORTED_LABEL,
         initDataTypes: ['cenc'],
         videoCapabilities: [{contentType: 'video/mp4; codecs="avc1.42E01E"'}],
         audioCapabilities: [{contentType: 'audio/mp4; codecs="mp4a.40.2"'}],
       }
     ],
@@ -412,48 +386,51 @@ var tests = [
       initDataTypes: ['cenc'],
       videoCapabilities: [{contentType: 'video/mp4; codecs="avc1.42E01E"'}],
       audioCapabilities: [{contentType: 'audio/mp4; codecs="mp4a.40.2"'}],
     },
     shouldPass: true,
   },
   {
     name: 'Basic WebM video',
+    keySystem: CLEARKEY_ID,
     options: [
       {
         label: SUPPORTED_LABEL,
         initDataTypes: ['webm'],
         videoCapabilities: [{contentType: 'video/webm'}],
       }
     ],
     expectedConfig: {
       label: SUPPORTED_LABEL,
       initDataTypes: ['webm'],
       videoCapabilities: [{contentType: 'video/webm'}],
     },
     shouldPass: true,
   },
   {
     name: 'Basic WebM audio',
+    keySystem: CLEARKEY_ID,
     options: [
       {
         label: SUPPORTED_LABEL,
         initDataTypes: ['webm'],
         audioCapabilities: [{contentType: 'audio/webm'}],
       }
     ],
     expectedConfig: {
       label: SUPPORTED_LABEL,
       initDataTypes: ['webm'],
       audioCapabilities: [{contentType: 'audio/webm'}],
     },
     shouldPass: true,
   },
   {
     name: 'Webm with Vorbis audio and VP8 video.',
+    keySystem: CLEARKEY_ID,
     options: [
       {
         label: SUPPORTED_LABEL,
         initDataTypes: ['webm'],
         videoCapabilities: [{contentType: 'video/webm;codecs="vp8"'}],
         audioCapabilities: [{contentType: 'audio/webm;codecs="vorbis"'}],
       }
     ],
@@ -462,16 +439,17 @@ var tests = [
       initDataTypes: ['webm'],
       videoCapabilities: [{contentType: 'video/webm;codecs="vp8"'}],
       audioCapabilities: [{contentType: 'audio/webm;codecs="vorbis"'}],
     },
     shouldPass: true,
   },
   {
     name: 'Webm with Vorbis audio and VP9 video.',
+    keySystem: CLEARKEY_ID,
     options: [
       {
         label: SUPPORTED_LABEL,
         initDataTypes: ['webm'],
         videoCapabilities: [{contentType: 'video/webm;codecs="vp9"'}],
         audioCapabilities: [{contentType: 'audio/webm;codecs="vorbis"'}],
       }
     ],
@@ -480,72 +458,73 @@ var tests = [
       initDataTypes: ['webm'],
       videoCapabilities: [{contentType: 'video/webm;codecs="vp9"'}],
       audioCapabilities: [{contentType: 'audio/webm;codecs="vorbis"'}],
     },
     shouldPass: true,
   },
   {
     name: 'Webm with bogus video.',
+    keySystem: CLEARKEY_ID,
     options: [
       {
         initDataTypes: ['webm'],
         videoCapabilities: [{contentType: 'video/webm;codecs="bogus"'}],
       }
     ],
     shouldPass: false,
   },
   {
     name: "CDM version less than",
-    keySystem: CLEARKEY_KEYSYSTEM + ".0",
+    keySystem: CLEARKEY_ID + ".0",
     options: [
       {
         label: SUPPORTED_LABEL,
         initDataTypes: ['cenc'],
         videoCapabilities: [{contentType: 'video/mp4'}],
       }
     ],
     expectedConfig: {
       label: SUPPORTED_LABEL,
       initDataTypes: ['cenc'],
       videoCapabilities: [{contentType: 'video/mp4'}],
     },
     shouldPass: true
   },
   {
     name: "CDM version equal to",
-    keySystem: CLEARKEY_KEYSYSTEM + ".1",
+    keySystem: CLEARKEY_ID + ".1",
     options: [
       {
         label: SUPPORTED_LABEL,
         initDataTypes: ['cenc'],
         videoCapabilities: [{contentType: 'video/mp4'}],
       }
     ],
     expectedConfig: {
       label: SUPPORTED_LABEL,
       initDataTypes: ['cenc'],
       videoCapabilities: [{contentType: 'video/mp4'}],
     },
     shouldPass: true
   },
   {
     name: "CDM version greater than",
-    keySystem: CLEARKEY_KEYSYSTEM + ".2",
+    keySystem: CLEARKEY_ID + ".2",
     options: [
       {
         initDataTypes: ['cenc'],
         videoCapabilities: [{contentType: 'video/mp4'}],
       }
     ],
     shouldPass: false
   },
   {
     name: "Non-whole number CDM version",
-    keySystem: CLEARKEY_KEYSYSTEM + ".0.1",
+    keySystem: CLEARKEY_ID + ".0.1",
     options: [
       {
         initDataTypes: ['cenc'],
         videoCapabilities: [{contentType: 'video/mp4'}],
       }
     ],
     shouldPass: false
   },
--- a/dom/media/test/test_eme_request_notifications.html
+++ b/dom/media/test/test_eme_request_notifications.html
@@ -31,17 +31,17 @@ function SetPrefs(prefs) {
 }
 
 function Test(test) {
   var p = test.prefs ? SetPrefs(test.prefs) : Promise.resolve();
   observedStatus = "nothing";
   var name = "'" + test.keySystem + "'";
   return p.then(function() {
     return new Promise(function(resolve, reject) {
-      navigator.requestMediaKeySystemAccess(test.keySystem, gCencMediaKeySystemConfig)
+      navigator.requestMediaKeySystemAccess(test.keySystem, [{initDataTypes:["cenc"]}])
       .then(
         function(keySystemAccess) {
           return keySystemAccess.createMediaKeys();
         })
       .then(
         function(mediaKeys) {
           ok(test.shouldPass, name + " passed and was expected to " + (test.shouldPass ? "pass" : "fail"));
           is(observedStatus, test.expectedStatus, name + " observer service result");
@@ -54,37 +54,39 @@ function Test(test) {
           is(observedStatus, test.expectedStatus, name + " observer service result");
           resolve();
         }
       );
     });
   });
 }
 
+const CLEARKEY_ID = 'org.w3.clearkey';
+
 var tests = [
   {
-    keySystem: CLEARKEY_KEYSYSTEM,
+    keySystem: CLEARKEY_ID,
     shouldPass: false,
     expectedStatus: 'api-disabled',
     prefs: [["media.eme.enabled", false], ["media.eme.clearkey.enabled", true]]
   },
   {
-    keySystem: CLEARKEY_KEYSYSTEM,
+    keySystem: CLEARKEY_ID,
     shouldPass: false,
     expectedStatus: 'cdm-disabled',
     prefs: [["media.eme.enabled", true], ["media.eme.clearkey.enabled", false]]
   },
   {
-    keySystem: CLEARKEY_KEYSYSTEM + '.10000' , // A stupendously high min CDM version, presumably not installed.
+    keySystem: CLEARKEY_ID + '.10000' , // A stupendously high min CDM version, presumably not installed.
     shouldPass: false,
     expectedStatus: 'cdm-insufficient-version',
     prefs: [["media.eme.enabled", true], ["media.eme.clearkey.enabled", true]]
   },
   {
-    keySystem: CLEARKEY_KEYSYSTEM,
+    keySystem: CLEARKEY_ID,
     shouldPass: true,
     expectedStatus: 'cdm-created',
     prefs: [["media.eme.enabled", true], ["media.eme.clearkey.enabled", true]]
   },
 ];
 
 SetupEMEPref(function() {
   tests.reduce(function(p,c,i,array) {
--- a/dom/media/test/test_eme_session_callable_value.html
+++ b/dom/media/test/test_eme_session_callable_value.html
@@ -7,17 +7,17 @@
   <script type="text/javascript" src="manifest.js"></script>
   <script type="text/javascript" src="eme.js"></script>
 </head>
 <body>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 function Test() {
-  navigator.requestMediaKeySystemAccess(CLEARKEY_KEYSYSTEM, gCencMediaKeySystemConfig)
+  navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{ initDataTypes: ['cenc'] }])
   .then(access => access.createMediaKeys())
   .then(mediaKeys => {
     var initData = (new TextEncoder()).encode( 'this is an invalid license, and that is ok');
     var s = mediaKeys.createSession("temporary");
     s.generateRequest("cenc", initData); // ignore result.
     // "update()" call should fail, because MediaKeySession is "not callable"
     // yet, since CDM won't have had a chance to set the sessionId on MediaKeySession.
     return s.update(initData);
--- a/dom/media/test/test_eme_setMediaKeys_before_attach_MediaSource.html
+++ b/dom/media/test/test_eme_setMediaKeys_before_attach_MediaSource.html
@@ -9,17 +9,17 @@
 </head>
 <body>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 
 function beginTest() {
   var video = document.createElement("video");
 
-  navigator.requestMediaKeySystemAccess(CLEARKEY_KEYSYSTEM, gCencMediaKeySystemConfig)
+  navigator.requestMediaKeySystemAccess("org.w3.clearkey", [{initDataTypes: ["cenc"]}])
     .then(function(keySystemAccess) {
       return keySystemAccess.createMediaKeys();
     })
     .then(mediaKeys => {
       return video.setMediaKeys(mediaKeys);
     })
     .then(() => {
       var ms = new MediaSource();