From a7e012482ab76be9858c6a83339da0aa52b5f044 Mon Sep 17 00:00:00 2001 From: Chris Pearce Date: Mon, 5 Oct 2015 15:03:58 +1300 Subject: [PATCH] Bug 1207019 - Make EME mochitests specify mime types for video in MediaKeys request videoTypes, ditto for audio. r=gerald --- dom/media/test/eme.js | 9 ++++++-- dom/media/test/manifest.js | 18 ++-------------- dom/media/test/test_can_play_type_mpeg.html | 2 ++ dom/media/test/test_eme_non_mse_fails.html | 7 ++++--- .../test/test_eme_requestKeySystemAccess.html | 21 ++++++++++++++----- 5 files changed, 31 insertions(+), 26 deletions(-) diff --git a/dom/media/test/eme.js b/dom/media/test/eme.js index 12032f11c776..64d2217e52cf 100644 --- a/dom/media/test/eme.js +++ b/dom/media/test/eme.js @@ -332,6 +332,11 @@ function SetupEME(test, token, params) }); } + function streamType(type) { + var x = test.tracks.find(o => o.name == type); + return x ? x.type : undefined; + } + // All 'initDataType's should be the same. // null indicates no 'encrypted' event received yet. var initDataType = null; @@ -353,8 +358,8 @@ function SetupEME(test, token, params) var options = [ { initDataType: ev.initDataType, - videoType: test.type, - audioType: test.type, + videoType: streamType("video"), + audioType: streamType("audio"), } ]; var p = navigator.requestMediaKeySystemAccess(KEYSYSTEM_TYPE, options); diff --git a/dom/media/test/manifest.js b/dom/media/test/manifest.js index 94991a0e0f0f..bdcdefa34b7e 100644 --- a/dom/media/test/manifest.js +++ b/dom/media/test/manifest.js @@ -792,7 +792,6 @@ var gEMETests = [ }, { name:"400x300 audio&video tracks, each with its key", - type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"", tracks: [ { name:"audio", @@ -824,7 +823,6 @@ var gEMETests = [ }, { name:"640x480@624kbps audio&video tracks, each with its key", - type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"", tracks: [ { name:"audio", @@ -856,7 +854,6 @@ var gEMETests = [ }, { name:"640x480@959kbps audio&video tracks, each with its key", - type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"", tracks: [ { name:"audio", @@ -888,7 +885,6 @@ var gEMETests = [ }, { name:"640x480 then 400x300, same key (1st) per track", - type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"", tracks: [ { name:"audio", @@ -921,7 +917,6 @@ var gEMETests = [ }, { name:"640x480 then 400x300, same key (2nd) per track", - type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"", tracks: [ { name:"audio", @@ -954,7 +949,6 @@ var gEMETests = [ }, { name:"640x480 with 1st keys then 400x300 with 2nd keys", - type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"", tracks: [ { name:"audio", @@ -988,7 +982,6 @@ var gEMETests = [ }, { name:"400x300 with 1st keys then 640x480 with 2nd keys", - type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"", tracks: [ { name:"audio", @@ -1022,7 +1015,6 @@ var gEMETests = [ }, { name:"640x480@959kbps with 1st keys then 640x480@624kbps with 2nd keys", - type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"", tracks: [ { name:"audio", @@ -1056,7 +1048,6 @@ var gEMETests = [ }, { name:"640x480@624kbps with 1st keys then 640x480@959kbps with 2nd keys", - type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"", tracks: [ { name:"audio", @@ -1090,7 +1081,6 @@ var gEMETests = [ }, { name:"400x300 with presentation size 533x300", - type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"", tracks: [ { name:"audio", @@ -1122,7 +1112,6 @@ var gEMETests = [ }, { name:"400x300 as-is then 400x300 presented as 533x300", - type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"", tracks: [ { name:"audio", @@ -1156,7 +1145,6 @@ var gEMETests = [ }, { name:"400x225", - type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"", tracks: [ { name:"audio", @@ -1187,7 +1175,6 @@ var gEMETests = [ }, { name:"640x360", - type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"", tracks: [ { name:"audio", @@ -1218,7 +1205,6 @@ var gEMETests = [ }, { name:"400x225 then 640x360", - type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"", tracks: [ { name:"audio", @@ -1252,7 +1238,6 @@ var gEMETests = [ }, { name:"640x360 then 640x480", - type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"", tracks: [ { name:"audio", @@ -1289,7 +1274,8 @@ var gEMETests = [ var gEMENonMSEFailTests = [ { name:"short-cenc.mp4", - type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"", + audioType:"audio/mp4; codecs=\"mp4a.40.2\"", + videoType:"video/mp4; codecs=\"avc1.64000d\"", duration:0.47, }, ]; diff --git a/dom/media/test/test_can_play_type_mpeg.html b/dom/media/test/test_can_play_type_mpeg.html index f9e410739962..19c574bfba99 100644 --- a/dom/media/test/test_can_play_type_mpeg.html +++ b/dom/media/test/test_can_play_type_mpeg.html @@ -69,6 +69,8 @@ function check_mp4(v, enabled) { check("audio/x-m4a; codecs=\"mp4a.40.2\"", "probably"); check("audio/x-m4a; codecs=mp4a.40.2", "probably"); + check("audio/mp4; codecs=\"mp4a.40.2,\"", ""); // Invalid codecs string + // HE-AAC v1 check("audio/mp4; codecs=\"mp4a.40.5\"", "probably"); check("audio/mp4; codecs=mp4a.40.5", "probably"); diff --git a/dom/media/test/test_eme_non_mse_fails.html b/dom/media/test/test_eme_non_mse_fails.html index 10d129391399..64e05a1b0548 100644 --- a/dom/media/test/test_eme_non_mse_fails.html +++ b/dom/media/test/test_eme_non_mse_fails.html @@ -12,11 +12,12 @@