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

Conversation

jrummell-chromium
Copy link
Contributor

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

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
// 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: hdcpPolicy});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might return a rejected promise, e.g. for clear key. Will this cause the test to fail? For the context, see WICG/hdcp-detection#2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test will fail, but if you look at the results you will see the failure due to error NotSupportedException. I think this is better for developers as they will see that it is not supported on the platform (by clear key, for example) and recognize they need to handle the failure. This is similar to the persistent-session tests (that are optional, but it is useful to know that persistent sessions aren't supported).

promise_test(
() => checkHdcpPolicy(''),
testnamePrefix(qualifier, config.keysystem) +
' support for empty HDCP policy.');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/policy/version

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -0,0 +1,26 @@
function runTest(config, qualifier)
{
function checkHdcpPolicy(hdcpPolicy)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be something like checkStatusForMinHdcpVersionPolicy(hdcpVersion)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

// 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: hdcpPolicy});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above. s/hdcpPolicy/hdcpVersion

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

<html>
<head>
<meta charset=utf-8>
<title>Encrypted Media Extensions: Check HDCP policy with Clear Key</title>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and below and in the file names, to be accurate, this should be something like "Check status for minHdcpVersion policy"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Kept the files names simple with check-hdcp-version.

@foolip foolip merged commit 2cc428d into web-platform-tests:master Jan 24, 2019
@jrummell-chromium jrummell-chromium deleted the check_hdcp_policy branch February 8, 2019 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants