diff --git a/dom/media/test/eme.js b/dom/media/test/eme.js index ec49c1511744..81f679762ce8 100644 --- a/dom/media/test/eme.js +++ b/dom/media/test/eme.js @@ -461,3 +461,35 @@ function SetupEMEPref(callback) { 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; +} diff --git a/dom/media/test/mochitest.ini b/dom/media/test/mochitest.ini index 87ff31f9ba20..42af1cc61e0e 100644 --- a/dom/media/test/mochitest.ini +++ b/dom/media/test/mochitest.ini @@ -540,6 +540,8 @@ support-files = 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 @@ -688,6 +690,8 @@ skip-if = toolkit == 'android' # bug 1149374 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] diff --git a/dom/media/test/short-audio-fragmented-cenc-without-pssh.mp4 b/dom/media/test/short-audio-fragmented-cenc-without-pssh.mp4 new file mode 100644 index 000000000000..bc58623999f9 Binary files /dev/null and b/dom/media/test/short-audio-fragmented-cenc-without-pssh.mp4 differ diff --git a/dom/media/test/short-audio-fragmented-cenc-without-pssh.mp4^headers^ b/dom/media/test/short-audio-fragmented-cenc-without-pssh.mp4^headers^ new file mode 100644 index 000000000000..4030ea1d3ddb --- /dev/null +++ b/dom/media/test/short-audio-fragmented-cenc-without-pssh.mp4^headers^ @@ -0,0 +1 @@ +Cache-Control: no-store diff --git a/dom/media/test/test_eme_missing_pssh.html b/dom/media/test/test_eme_missing_pssh.html new file mode 100644 index 000000000000..196ced4022b1 --- /dev/null +++ b/dom/media/test/test_eme_missing_pssh.html @@ -0,0 +1,92 @@ + + + + Test Encrypted Media Extensions + + + + + + + +
+    
+  
+ +