Bug 1307019 - Testcase for encrypted MP4 without PSSH and MDSM waiting-for-CDM. r=jya, a=sylvestre
authorChris Pearce <cpearce@mozilla.com>
Mon, 03 Oct 2016 16:35:27 +1300
changeset 350563 5350691a386ad2d390d661eaacd2617647b95175
parent 350562 1aac04b95158acd6df883fcdfaae6c0927f4e365
child 350564 437cc9b7e8607a00aaa9f5072db40d7a4ab16a2f
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya, sylvestre
bugs1307019, 1300069
milestone50.0
Bug 1307019 - Testcase for encrypted MP4 without PSSH and MDSM waiting-for-CDM. r=jya, a=sylvestre Tests that a fragmented MP4 file without a PSSH, but with encrypted valid tracks with valid TENC boxes, is able to load with EME. This is a test for the code path added in bug 1300069. We setup MSE before starting up EME, so that we exercise the "waiting for cdm" step in the MediaDecoderStateMachine, which was regressed in bug 1300069. MozReview-Commit-ID: BXgdzAikWoH
dom/media/test/eme.js
dom/media/test/mochitest.ini
dom/media/test/short-audio-fragmented-cenc-without-pssh.mp4
dom/media/test/short-audio-fragmented-cenc-without-pssh.mp4^headers^
dom/media/test/test_eme_missing_pssh.html
--- a/dom/media/test/eme.js
+++ b/dom/media/test/eme.js
@@ -431,8 +431,40 @@ function SetupEMEPref(callback) {
   if (SpecialPowers.Services.appinfo.name == "B2G" ||
       !manifestVideo().canPlayType("video/mp4")) {
     // XXX remove once we have mp4 PlatformDecoderModules on all platforms.
     prefs.push([ "media.use-blank-decoder", true ]);
   }
 
   SpecialPowers.pushPrefEnv({ "set" : prefs }, callback);
 }
+
+function fetchWithXHR(uri, onLoadFunction) {
+  var p = new Promise(function(resolve, reject) {
+    var xhr = new XMLHttpRequest();
+    xhr.open("GET", uri, true);
+    xhr.responseType = "arraybuffer";
+    xhr.addEventListener("load", function () {
+      is(xhr.status, 200, "fetchWithXHR load uri='" + uri + "' status=" + xhr.status);
+      resolve(xhr.response);
+    });
+    xhr.send();
+  });
+
+  if (onLoadFunction) {
+    p.then(onLoadFunction);
+  }
+
+  return p;
+};
+
+function once(target, name, cb) {
+  var p = new Promise(function(resolve, reject) {
+    target.addEventListener(name, function onceEvent(arg) {
+      target.removeEventListener(name, onceEvent);
+      resolve(arg);
+    });
+  });
+  if (cb) {
+    p.then(cb);
+  }
+  return p;
+}
--- a/dom/media/test/mochitest.ini
+++ b/dom/media/test/mochitest.ini
@@ -502,16 +502,18 @@ support-files =
   seekLies.sjs
   seek_with_sound.ogg^headers^
   sequential.vtt
   short-cenc.mp4
   sine.webm
   sine.webm^headers^
   short.mp4
   short.mp4^headers^
+  short-audio-fragmented-cenc-without-pssh.mp4
+  short-audio-fragmented-cenc-without-pssh.mp4^headers^
   short-video.ogv
   short-video.ogv^headers^
   small-shot-mp3.mp4
   small-shot-mp3.mp4^headers^
   small-shot.m4a
   small-shot.mp3
   small-shot.mp3^headers^
   small-shot.ogg
@@ -647,16 +649,18 @@ skip-if = buildapp == 'b2g' && toolkit !
 skip-if = (os == 'win' && os_version == '5.1') || (os != 'win' && toolkit != 'gonk')
 [test_eme_session_callable_value.html]
 [test_eme_canvas_blocked.html]
 skip-if = toolkit == 'android' # bug 1149374
 [test_eme_detach_media_keys.html]
 skip-if = toolkit == 'android' # bug 1149374
 [test_eme_initDataTypes.html]
 skip-if = toolkit == 'android' # bug 1149374
+[test_eme_missing_pssh.html]
+skip-if = toolkit == 'android' # bug 1149374
 [test_eme_non_mse_fails.html]
 skip-if = toolkit == 'android' # bug 1149374
 [test_eme_request_notifications.html]
 skip-if = toolkit == 'android' # bug 1149374
 [test_eme_persistent_sessions.html]
 skip-if = toolkit == 'android' # bug 1149374
 [test_eme_playback.html]
 skip-if = toolkit == 'android' || toolkit == 'gonk' # android: bug 1149374; gonk: bug 1193351
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..bc58623999f9779a9fcd85a71793cb17646ec547
GIT binary patch
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ztwlqS(ICV5fKeIWI-AaSsRb!;_~+%ILmwd^oXG3M=Na_xHx8unn@!Z^N?fN^$W<gZ
zbrSFSlHCo~yV7e(`23GH23#K>7sV-TbRywIT1dPsLwfCWG7Kj?g|*=B6ie#>K~d5q
zbk(;&q26eVeb?G!ZD%^lUOo<T0U+P_tccyleXNA#u4v2D9VgqTn05@~ks*&wFNw_O
z$t16`JzFX_bh@UUb2r>~w&YnJE|`KhIgwNNsf#CAvM;b1`0Y)2Tv?!|*qNcxwvU~@
z(Yh`gS=nfUE8LOg+)+e6xFtH~&uCea2(J|96RI+wSwT#au*wv0wIW~~K95?*A*=fn
z6<3;3&$#*3xrbq@I;S9+Hx(wXsb=lcIK`1wdd!4M;u<lQc;6eu6HQ(%n=qypXg?#h
z*-NRhE%3Wsm4DcV>U4IN6sD}T5B5>mp^eFXxr9plyiHd%P8v+c@d^EaCrD!Rj2B0b
zNx>nrV$X0o<n03+Ap*7eHWi5KfTN}hLWu5c(Tu8kxpRg=i1C?wBZO8ePGM&VNBn^q
v9mmt1d5PN-000QuTe$qX#X$}IOaBts|6T(4jr%aa@6upBx&D1WK=A(n==}E#
new file mode 100644
--- /dev/null
+++ b/dom/media/test/short-audio-fragmented-cenc-without-pssh.mp4^headers^
@@ -0,0 +1,1 @@
+Cache-Control: no-store
new file mode 100644
--- /dev/null
+++ b/dom/media/test/test_eme_missing_pssh.html
@@ -0,0 +1,92 @@
+<!DOCTYPE HTML>
+<html>
+  <head>
+    <title>Test Encrypted Media Extensions</title>
+    <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+    <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>
+    <audio controls id="audio"></audio>
+    <pre id="test">
+    <script class="testbody" type="text/javascript">
+
+      // Tests that a fragmented MP4 file without a PSSH, but with valid encrypted
+      // tracks with valid TENC boxes, is able to load with EME.
+      // We setup MSE before starting up EME, so that we exercise the "waiting for
+      // cdm" step in the MediaDecoderStateMachine.
+
+      SimpleTest.waitForExplicitFinish();
+
+      var pssh = [
+        0x00, 0x00, 0x00, 0x00,
+        0x70, 0x73, 0x73, 0x68, // BMFF box header (76 bytes, 'pssh')
+        0x01, 0x00, 0x00, 0x00,                         // Full box header (version = 1, flags = 0)
+        0x10, 0x77, 0xef, 0xec, 0xc0, 0xb2, 0x4d, 0x02, // SystemID
+        0xac, 0xe3, 0x3c, 0x1e, 0x52, 0xe2, 0xfb, 0x4b,
+        0x00, 0x00, 0x00, 0x01,                         // KID_count (1)
+        0x2f, 0xef, 0x8a, 0xd8, 0x12, 0xdf, 0x42, 0x97,
+        0x83, 0xe9, 0xbf, 0x6e, 0x5e, 0x49, 0x3e, 0x53,
+        0x00, 0x00, 0x00, 0x00                         // Size of Data (0)
+      ];
+
+      var audio = document.getElementById("audio");
+
+      function LoadEME() {
+        var options = [{
+          initDataType: 'cenc',
+          audioType: 'audio/mp4; codecs="mp4a.40.2"',
+        }];
+        navigator.requestMediaKeySystemAccess("org.w3.clearkey", options)
+          .then((keySystemAccess) => {
+            return keySystemAccess.createMediaKeys();
+          }, bail("Failed to request key system access."))
+
+          .then((mediaKeys) => {
+            audio.setMediaKeys(mediaKeys);
+            var session = mediaKeys.createSession();
+            once(session, "message", (message) => {
+              is(message.messageType, 'license-request', "Expected a license-request");
+              var license = new TextEncoder().encode(JSON.stringify({
+                'keys': [{
+                  'kty':'oct',
+                  'kid':'L--K2BLfQpeD6b9uXkk-Uw',
+                  'k':HexToBase64('7f412f0575f44f718259beef56ec7771')
+                 }],
+                 'type': 'temporary'
+              }));
+              session.update(license);
+            });
+            session.generateRequest('cenc', new Uint8Array(pssh));
+          });
+      }
+
+      function DownloadMedia(url, type, mediaSource) {
+        return new Promise(function(resolve, reject) {
+          var sourceBuffer = mediaSource.addSourceBuffer(type);
+          fetchWithXHR(url, (response) => {
+            once(sourceBuffer, "updateend", resolve);
+            sourceBuffer.appendBuffer(new Uint8Array(response));
+          });
+        });
+      }
+
+      function LoadMSE() {
+        var ms = new MediaSource();
+        audio.src = URL.createObjectURL(ms);
+
+        once(ms, "sourceopen", ()=>{
+          DownloadMedia('short-audio-fragmented-cenc-without-pssh.mp4', 'audio/mp4; codecs="mp4a.40.2"', ms)
+            .then(() => { ms.endOfStream(); LoadEME();});
+        });
+
+        audio.addEventListener("loadeddata", SimpleTest.finish);
+      }
+
+      SetupEMEPref(LoadMSE);
+
+  </script>
+  </pre>
+  </body>
+</html>