- Revision
- 222085
- Author
- [email protected]
- Date
- 2017-09-15 06:24:46 -0700 (Fri, 15 Sep 2017)
Log Message
[EME] ClearKey: list 'persistent-license' sessions as supported
https://bugs.webkit.org/show_bug.cgi?id=176985
Reviewed by Xabier Rodriguez-Calvar.
Source/WebCore:
The ClearKey implementation should support the 'persistent-license'
session type for testing purposes. Methods in the CDMPrivateClearKey
class have been updated to handle that session type as supported:
- supportsSessionTypeWithConfiguration() returns true for the
'persistent-license' session type values,
- supportsConfiguration() allows persistent state as required in
case of the configured session type being 'persistent-license',
- supportsConfigurationWithRestrictions() as well allows persistent
state as required for 'persistent-license' session types.
No new tests -- affected tests have their baselines updated.
* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::CDMPrivateClearKey::supportsConfiguration const):
(WebCore::CDMPrivateClearKey::supportsConfigurationWithRestrictions const):
(WebCore::CDMPrivateClearKey::supportsSessionTypeWithConfiguration const):
LayoutTests:
Update WPE test baselines for EME ClearKey tests.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-persistent-license-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-destroy-persistent-license-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-persistent-license-expected.txt:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (222084 => 222085)
--- trunk/LayoutTests/ChangeLog 2017-09-15 13:22:07 UTC (rev 222084)
+++ trunk/LayoutTests/ChangeLog 2017-09-15 13:24:46 UTC (rev 222085)
@@ -1,3 +1,16 @@
+2017-09-15 Zan Dobersek <[email protected]>
+
+ [EME] ClearKey: list 'persistent-license' sessions as supported
+ https://bugs.webkit.org/show_bug.cgi?id=176985
+
+ Reviewed by Xabier Rodriguez-Calvar.
+
+ Update WPE test baselines for EME ClearKey tests.
+
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-persistent-license-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-destroy-persistent-license-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-persistent-license-expected.txt:
+
2017-09-15 Claudio Saavedra <[email protected]>
[WPE] Rebaseline test expectations after r222077.
Modified: trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-persistent-license-expected.txt (222084 => 222085)
--- trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-persistent-license-expected.txt 2017-09-15 13:22:07 UTC (rev 222084)
+++ trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-persistent-license-expected.txt 2017-09-15 13:24:46 UTC (rev 222085)
@@ -1,3 +1,3 @@
-FAIL org.w3.clearkey, persistent-license, mp4playback assert_unreached: NotSupportedError: The operation is not supported. Reached unreachable code
+PASS org.w3.clearkey, persistent-license, mp4playback
Modified: trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-destroy-persistent-license-expected.txt (222084 => 222085)
--- trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-destroy-persistent-license-expected.txt 2017-09-15 13:22:07 UTC (rev 222084)
+++ trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-destroy-persistent-license-expected.txt 2017-09-15 13:24:46 UTC (rev 222085)
@@ -1,3 +1,6 @@
+CONSOLE MESSAGE: line 81: TypeError: navigator.requestMediaKeySystemAccess is not a function. (In 'navigator.requestMediaKeySystemAccess(config.keysystem, [ configuration ] )', 'navigator.requestMediaKeySystemAccess' is undefined)
-FAIL org.w3.clearkey, persistent-license, mp4, playback, retrieve, playback and destroy assert_unreached: NotSupportedError: The operation is not supported. Reached unreachable code
+Harness Error (TIMEOUT), message = null
+TIMEOUT org.w3.clearkey, persistent-license, mp4, playback, retrieve, playback and destroy Test timed out
+
Modified: trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-persistent-license-expected.txt (222084 => 222085)
--- trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-persistent-license-expected.txt 2017-09-15 13:22:07 UTC (rev 222084)
+++ trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-persistent-license-expected.txt 2017-09-15 13:24:46 UTC (rev 222085)
@@ -1,3 +1,6 @@
+CONSOLE MESSAGE: line 53: TypeError: navigator.requestMediaKeySystemAccess is not a function. (In 'navigator.requestMediaKeySystemAccess(config.keysystem, [ configuration ] )', 'navigator.requestMediaKeySystemAccess' is undefined)
-FAIL org.w3.clearkey, persistent-license, mp4, playback, retrieve and playback assert_unreached: NotSupportedError: The operation is not supported. Reached unreachable code
+Harness Error (TIMEOUT), message = null
+TIMEOUT org.w3.clearkey, persistent-license, mp4, playback, retrieve and playback Test timed out
+
Modified: trunk/Source/WebCore/ChangeLog (222084 => 222085)
--- trunk/Source/WebCore/ChangeLog 2017-09-15 13:22:07 UTC (rev 222084)
+++ trunk/Source/WebCore/ChangeLog 2017-09-15 13:24:46 UTC (rev 222085)
@@ -1,3 +1,27 @@
+2017-09-15 Zan Dobersek <[email protected]>
+
+ [EME] ClearKey: list 'persistent-license' sessions as supported
+ https://bugs.webkit.org/show_bug.cgi?id=176985
+
+ Reviewed by Xabier Rodriguez-Calvar.
+
+ The ClearKey implementation should support the 'persistent-license'
+ session type for testing purposes. Methods in the CDMPrivateClearKey
+ class have been updated to handle that session type as supported:
+ - supportsSessionTypeWithConfiguration() returns true for the
+ 'persistent-license' session type values,
+ - supportsConfiguration() allows persistent state as required in
+ case of the configured session type being 'persistent-license',
+ - supportsConfigurationWithRestrictions() as well allows persistent
+ state as required for 'persistent-license' session types.
+
+ No new tests -- affected tests have their baselines updated.
+
+ * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
+ (WebCore::CDMPrivateClearKey::supportsConfiguration const):
+ (WebCore::CDMPrivateClearKey::supportsConfigurationWithRestrictions const):
+ (WebCore::CDMPrivateClearKey::supportsSessionTypeWithConfiguration const):
+
2017-09-15 Ms2ger <[email protected]>
Disallow passing a null program to getFragDataLocation.
Modified: trunk/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp (222084 => 222085)
--- trunk/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp 2017-09-15 13:22:07 UTC (rev 222084)
+++ trunk/Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp 2017-09-15 13:24:46 UTC (rev 222085)
@@ -173,12 +173,23 @@
return equalLettersIgnoringASCIICase(initDataType, "keyids");
}
+bool containsPersistentLicenseType(const Vector<CDMSessionType>& types)
+{
+ return std::any_of(types.begin(), types.end(),
+ [] (auto& sessionType) { return sessionType == CDMSessionType::PersistentLicense; });
+}
+
bool CDMPrivateClearKey::supportsConfiguration(const CDMKeySystemConfiguration& configuration) const
{
- // Reject any configuration that marks distinctive identifier or persistent state as required.
- if (configuration.distinctiveIdentifier == CDMRequirement::Required
- || configuration.persistentState == CDMRequirement::Required)
+ // Reject any configuration that marks distinctive identifier as required.
+ if (configuration.distinctiveIdentifier == CDMRequirement::Required)
return false;
+
+ // Reject any configuration that marks persistent state as required, unless
+ // the 'persistent-license' session type has to be supported.
+ if (configuration.persistentState == CDMRequirement::Required && !containsPersistentLicenseType(configuration.sessionTypes))
+ return false;
+
return true;
}
@@ -190,18 +201,23 @@
|| configuration.distinctiveIdentifier == CDMRequirement::Required)
return false;
- // Ditto for persistent state.
- if ((configuration.persistentState == CDMRequirement::Optional && restrictions.persistentStateDenied)
- || configuration.persistentState == CDMRequirement::Required)
+ // Reject any configuration that marks persistent state as optional even when
+ // restrictions mark it as denied.
+ if (configuration.persistentState == CDMRequirement::Optional && restrictions.persistentStateDenied)
return false;
+ // Reject any configuration that marks persistent state as required, unless
+ // the 'persistent-license' session type has to be supported.
+ if (configuration.persistentState == CDMRequirement::Required && !containsPersistentLicenseType(configuration.sessionTypes))
+ return false;
+
return true;
}
bool CDMPrivateClearKey::supportsSessionTypeWithConfiguration(CDMSessionType& sessionType, const CDMKeySystemConfiguration& configuration) const
{
- // Only support the temporary session type.
- if (sessionType != CDMSessionType::Temporary)
+ // Only support the 'temporary' and 'persistent-license' session types.
+ if (sessionType != CDMSessionType::Temporary && sessionType != CDMSessionType::PersistentLicense)
return false;
return supportsConfiguration(configuration);
}