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

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

Issue 806653004: Revert "Remove MediaKeys.isTypeSupported()." (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/media/encrypted-media/encrypted-media-v2-syntax.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/media/encrypted-media/encrypted-media-utils.js
diff --git a/LayoutTests/media/encrypted-media/encrypted-media-utils.js b/LayoutTests/media/encrypted-media/encrypted-media-utils.js
index 3217732198c831811c17180978a05515f2a2cd04..d497bcac55a95ce30934e97411e035c05aea5e6f 100644
--- a/LayoutTests/media/encrypted-media/encrypted-media-utils.js
+++ b/LayoutTests/media/encrypted-media/encrypted-media-utils.js
@@ -12,45 +12,9 @@ function consoleWrite(text)
console.appendChild(span);
}
-// FIXME: Detect EME support rather than just general container support.
-// http://crbug.com/441585
-// For now, assume that implementations that support a container type for clear
-// content and are running these tests also support that container with EME.
-// Because this code creates an ActiveDOMObject, which could break the lifetime
-// tests, we must run it before the actual tests run and save the results for
-// use in the tests.
-var element = new Audio();
-var isWebMSupported = ('' != element.canPlayType('video/webm'));
-var isCencSupported = ('' != element.canPlayType('video/mp4'));
-// Force the ActiveDOMObject to be deleted before the tests run.
-element = null;
-asyncGC();
-
-function isInitDataTypeSupported(initDataType)
-{
- var result = false;
- switch (initDataType) {
- case 'webm':
- result = isWebMSupported;
- break;
- case 'cenc':
- result = isCencSupported;
- break;
- default:
- result = false;
- }
-
- return result;
-}
-
-
function getInitDataType()
{
- if (isInitDataTypeSupported('webm'))
- return 'webm';
- if (isInitDataTypeSupported('cenc'))
- return 'cenc';
- throw 'No supported Initialization Data Types';
+ return (MediaKeys.isTypeSupported('org.w3.clearkey', 'video/webm')) ? 'webm' : 'cenc';
}
function getInitData(initDataType)
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/media/encrypted-media/encrypted-media-v2-syntax.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698