Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[eme] Check if HDCP policy is supported #14384

Merged
merged 3 commits into from
Jan 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions encrypted-media/clearkey-check-status-for-hdcp.https.html
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>
32 changes: 32 additions & 0 deletions encrypted-media/drm-check-status-for-hdcp.https.html
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>
26 changes: 26 additions & 0 deletions encrypted-media/scripts/check-status-for-hdcp.js
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.');
}