Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Unified Diff: third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-utils.js

Issue 2084053002: EME: Update tests so 'audioCapabilities' always provided (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-utils.js
diff --git a/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-utils.js b/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-utils.js
index b1e6c9207f295fb506d400ff9161e0960c9b470a..361133f11f2eeb9c0d532a96455c35063d9527bf 100644
--- a/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-utils.js
+++ b/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-utils.js
@@ -71,6 +71,19 @@ function getInitData(initDataType)
throw 'initDataType ' + initDataType + ' not supported.';
}
+// Returns a promise from navigator.requestMediaKeySystemAccess for Clear Key
+// that is fulfilled if the initDataType is supported, rejected if it is not.
+function requestClearKeySystemAccessForInitType(initDataType)
+{
+ var configuration = [ {
+ initDataTypes: [ initDataType ],
+ videoCapabilities: [
+ { contentType: 'video/webm; codecs="vp8"' }
ddorwin 2016/06/21 22:42:47 If we're going to pick one type, let's pick audio.
jrummell 2016/06/23 22:04:21 The encrypted-media-playback tests play a webm fil
+ ]
+ } ];
+ return navigator.requestMediaKeySystemAccess('org.w3.clearkey', configuration);
+}
+
function waitForEventAndRunStep(eventName, element, func, stepTest)
{
var eventCallback = function(event) {
@@ -268,7 +281,7 @@ function createMediaKeys(keyId, key)
var request = stringToUint8Array(createKeyIDs(keyId));
var jwkSet = stringToUint8Array(createJWKSet(createJWK(keyId, key)));
- return navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).then(function(access) {
+ return requestClearKeySystemAccessForInitType('keyids').then(function(access) {
return access.createMediaKeys();
}).then(function(result) {
mediaKeys = result;

Powered by Google App Engine
This is Rietveld 408576698