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

Unified Diff: third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-unique-origin.html

Issue 2678433003: media: Require SecureContext for EME APIs (Closed)
Patch Set: rebase only Created 3 years, 10 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-unique-origin.html
diff --git a/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-unique-origin.html b/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-unique-origin.html
index 4492bde4406bf41d2b837831c372226161c833c7..bfadd30c9775dc1fc18cc9f27077d1d8e8293729 100644
--- a/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-unique-origin.html
+++ b/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-unique-origin.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
- <title>Unique origin is unable to create MediaKeys</title>
+ <title>requestMediaKeySystemAccess() is not available on unique origin</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
@@ -31,22 +31,15 @@
}
promise_test(function(test) {
+ // TODO(xhwang): Also check other EME APIs.
var script = 'data:text/html,' +
'<script>' +
' window.onmessage = function(e) {' +
- ' navigator.requestMediaKeySystemAccess(\'org.w3.clearkey\', [{' +
- ' initDataTypes: [ \'keyids\' ],' +
- ' audioCapabilities: [' +
- ' { contentType: \'audio/mp4; codecs="mp4a.40.2"\' },' +
- ' { contentType: \'audio/webm; codecs="opus"\' }' +
- ' ]' +
- ' }]).then(function(access) {' +
- ' return access.createMediaKeys();' +
- ' }).then(function(mediaKeys) {' +
- ' window.parent.postMessage({result: \'allowed\'}, \'*\');' +
- ' }, function(error) {' +
- ' window.parent.postMessage({result: \'failed\'}, \'*\');' +
- ' });' +
+ ' if (\'requestMediaKeySystemAccess\' in navigator) {' +
+ ' window.parent.postMessage({result: \'available\'}, \'*\');' +
+ ' } else { ' +
+ ' window.parent.postMessage({result: \'unavailable\'}, \'*\');' +
+ ' }' +
' };' +
'<\/script>';
@@ -66,9 +59,9 @@
iframe.contentWindow.postMessage({}, '*');
return wait_for_message();
}).then(function(message) {
- assert_equals(message.result, 'failed');
+ assert_equals(message.result, 'unavailable');
});
- }, 'Unique origin is unable to create MediaKeys');
+ }, 'requestMediaKeySystemAccess() is not available on unique origin');
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698