-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[eme] Check if HDCP policy is supported (#14384)
In [1] there is a proposal to add the ability to know before fetching content if HDCP (and what version) can be enforced. This adds a test to check if it is supported. [1] https://github.com/WICG/hdcp-detection/blob/master/explainer.md
- Loading branch information
1 parent
01e59d3
commit 2cc428d
Showing
3 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset=utf-8> | ||
<title>Encrypted Media Extensions: Check HDCP status with Clear Key</title> | ||
<link rel="help" href="https://w3c.github.io/encrypted-media/"> | ||
|
||
<!-- Web Platform Test Harness scripts --> | ||
<script src=/resources/testharness.js></script> | ||
<script src=/resources/testharnessreport.js></script> | ||
|
||
<!-- Helper scripts for Encrypted Media Extensions tests --> | ||
<script src=/encrypted-media/util/utils.js></script> | ||
<script src=/encrypted-media/util/utf8.js></script> | ||
|
||
<!-- Content metadata --> | ||
<!--<script src=/encrypted-media/content/content-metadata.js></script>--> | ||
|
||
<!-- The script for this specific test --> | ||
<script src=/encrypted-media/scripts/check-status-for-hdcp.js></script> | ||
|
||
</head> | ||
<body> | ||
<div id='log'></div> | ||
|
||
<script> | ||
var config = { keysystem: 'org.w3.clearkey' } | ||
|
||
runTest(config); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset=utf-8> | ||
<title>Encrypted Media Extensions: Check HDCP status with DRM</title> | ||
<link rel="help" href="https://w3c.github.io/encrypted-media/"> | ||
|
||
<!-- Web Platform Test Harness scripts --> | ||
<script src=/resources/testharness.js></script> | ||
<script src=/resources/testharnessreport.js></script> | ||
|
||
<!-- Helper scripts for Encrypted Media Extensions tests --> | ||
<script src=/encrypted-media/util/utils.js></script> | ||
<script src=/encrypted-media/util/utf8.js></script> | ||
|
||
<!-- Content metadata --> | ||
<!--<script src=/encrypted-media/content/content-metadata.js></script>--> | ||
|
||
<!-- The script for this specific test --> | ||
<script src=/encrypted-media/scripts/check-status-for-hdcp.js></script> | ||
|
||
</head> | ||
<body> | ||
<div id='log'></div> | ||
|
||
<script> | ||
var config = { keysystem: getSupportedKeySystem() } | ||
|
||
runTest(config); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
function runTest(config, qualifier) | ||
{ | ||
function checkStatusForMinHdcpVersionPolicy(hdcpVersion) | ||
{ | ||
return navigator.requestMediaKeySystemAccess(config.keysystem, getSimpleConfiguration()) | ||
.then(function(access) { | ||
return access.createMediaKeys(); | ||
}) | ||
.then(function(mediaKeys) { | ||
// As HDCP policy depends on the hardware running this test, | ||
// don't bother checking the result returned as it may or | ||
// may not be supported. This simply verifies that | ||
// getStatusForPolicy() exists and doesn't blow up. | ||
return mediaKeys.getStatusForPolicy({minHdcpVersion: hdcpVersion}); | ||
}); | ||
} | ||
|
||
promise_test( | ||
() => checkStatusForMinHdcpVersionPolicy(''), | ||
testnamePrefix(qualifier, config.keysystem) + | ||
' support for empty HDCP version.'); | ||
|
||
promise_test( | ||
() => checkStatusForMinHdcpVersionPolicy('1.0'), | ||
testnamePrefix(qualifier, config.keysystem) + ' support for HDCP 1.0.'); | ||
} |