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

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/encrypted-media/scripts/check-initdata-type.js

Issue 2546853003: Add W3C encrypted-media tests (Closed)
Patch Set: rebase now that content files landed Created 4 years 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/imported/wpt/encrypted-media/scripts/check-initdata-type.js
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/encrypted-media/scripts/check-initdata-type.js b/third_party/WebKit/LayoutTests/imported/wpt/encrypted-media/scripts/check-initdata-type.js
new file mode 100644
index 0000000000000000000000000000000000000000..5c7cb6e4b9a427d4f15364027724e13ba836d89e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/wpt/encrypted-media/scripts/check-initdata-type.js
@@ -0,0 +1,35 @@
+ function runTest( config, qualifier )
+ {
+ function checkInitDataType(initDataType)
+ {
+ return isInitDataTypeSupported(initDataType).then(function(result) {
+ // If |initDataType| is not supported, simply succeed.
+ if (!result)
+ return Promise.resolve('Not supported');
+
+ return navigator.requestMediaKeySystemAccess( config.keysystem, getSimpleConfigurationForInitDataType(initDataType))
+ .then(function(access) {
+ return access.createMediaKeys();
+ }).then(function(mediaKeys) {
+ var mediaKeySession = mediaKeys.createSession();
+ var initData = getInitData(initDataType);
+ return mediaKeySession.generateRequest(initDataType, initData);
+ });
+ });
+ }
+
+ promise_test(function()
+ {
+ return checkInitDataType('webm');
+ }, testnamePrefix( qualifier, config.keysystem ) + ' support for "webm".');
+
+ promise_test(function()
+ {
+ return checkInitDataType('cenc');
+ }, testnamePrefix( qualifier, config.keysystem ) + ' support for "cenc".');
+
+ promise_test(function()
+ {
+ return checkInitDataType('keyids');
+ }, testnamePrefix( qualifier, config.keysystem ) + ' support for "keyids".');
+}

Powered by Google App Engine
This is Rietveld 408576698