https://bugs.webkit.org/show_bug.cgi?id=175136
Reviewed by Xabier Rodriguez-Calvar.
Source/WebCore:
Register the ClearKey CDM factory in CDMFactoryGStreamer. A CDMFactoryClearKey
singleton object is introduced and used for that registration.
The basic CDMFactoryClearKey and CDMPrivateClearKey methods are implemented,
marking `org.w3.clearkey` as the supported key system and `keyids` as the
supported init data type. Additional logic around key system configurations,
distinctive identifiers, persistent state and related restrictions and
requirements is implemented.
This improves the ClearKey EME tests a bit, now progressing to the point of
failing with a NotAllowedError exception due to the CDMInstance object failing
to properly initialize because of missing implementation.
No new tests -- relevant tests have underlying baselines updated to reflect
changes in behavior.
* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::CDMFactoryClearKey::singleton):
(WebCore::CDMFactoryClearKey::supportsKeySystem):
(WebCore::CDMPrivateClearKey::supportsInitDataType const):
(WebCore::CDMPrivateClearKey::supportsConfiguration const):
(WebCore::CDMPrivateClearKey::supportsConfigurationWithRestrictions const):
(WebCore::CDMPrivateClearKey::supportsSessionTypeWithConfiguration const):
(WebCore::CDMPrivateClearKey::supportsRobustness const):
(WebCore::CDMPrivateClearKey::distinctiveIdentifiersRequirement const):
(WebCore::CDMPrivateClearKey::persistentStateRequirement const):
* platform/encryptedmedia/clearkey/CDMClearKey.h:
* platform/graphics/gstreamer/eme/CDMFactoryGStreamer.cpp:
(WebCore::CDMFactory::platformRegisterFactories):
LayoutTests:
Update WPE baselines for EME ClearKey tests following some advancements in
ClearKey support.
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-events-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-events-session-closed-event-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-generate-request-disallowed-input-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-invalid-license-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-keystatuses-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-keystatuses-multiple-sessions-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-clear-encrypted-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-encrypted-clear-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-encrypted-clear-sources-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-events-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-sequential-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-sequential-readyState-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multisession-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-after-src-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-after-update-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-immediately-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-onencrypted-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-two-videos-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-requestmediakeysystemaccess-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-reset-src-after-setmediakeys-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-again-after-playback-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-again-after-resetting-src-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-at-same-time-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-multiple-times-with-the-same-mediakeys-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-to-multiple-video-elements-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-syntax-mediakeys-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-syntax-mediakeysession-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-syntax-mediakeysystemaccess-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-update-disallowed-input-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-waiting-for-a-key-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-not-callable-after-createsession-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-update-non-ascii-input-expected.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220269
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2017-08-04 Zan Dobersek <zdobersek@igalia.com>
+
+ [EME][GStreamer] Register ClearKey CDMFactory
+ https://bugs.webkit.org/show_bug.cgi?id=175136
+
+ Reviewed by Xabier Rodriguez-Calvar.
+
+ Update WPE baselines for EME ClearKey tests following some advancements in
+ ClearKey support.
+
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-events-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-events-session-closed-event-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-generate-request-disallowed-input-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-invalid-license-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-keystatuses-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-keystatuses-multiple-sessions-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-clear-encrypted-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-encrypted-clear-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-encrypted-clear-sources-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-events-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-sequential-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-sequential-readyState-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multisession-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-after-src-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-after-update-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-immediately-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-onencrypted-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-two-videos-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-requestmediakeysystemaccess-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-reset-src-after-setmediakeys-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-again-after-playback-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-again-after-resetting-src-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-at-same-time-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-multiple-times-with-the-same-mediakeys-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-to-multiple-video-elements-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-syntax-mediakeys-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-syntax-mediakeysession-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-syntax-mediakeysystemaccess-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-update-disallowed-input-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-waiting-for-a-key-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-not-callable-after-createsession-expected.txt:
+ * platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-update-non-ascii-input-expected.txt:
+
2017-08-04 John Wilander <wilander@apple.com>
Resource Load Statistics: Report user interaction immediately, but only when needed
-CONSOLE MESSAGE: line 272: Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'contentitem.audio')
-FAIL Encrypted Media Extensions: Events with Clear Key undefined is not an object (evaluating 'contentitem.audio')
+FAIL org.w3.clearkey, basic events assert_unreached: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. Reached unreachable code
-FAIL org.w3.clearkey test MediaKeySession closed event. assert_unreached: Error: NotSupportedError Reached unreachable code
+FAIL org.w3.clearkey test MediaKeySession closed event. assert_unreached: Error: NotAllowedError Reached unreachable code
-Harness Error (TIMEOUT), message = null
-
+FAIL org.w3.clearkey, temporary, keyids, initData longer than 64Kb characters assert_equals: expected "TypeError" but got "NotAllowedError"
+FAIL org.w3.clearkey, temporary, keyids, invalid initdata (too short key ID) assert_equals: expected "TypeError" but got "NotAllowedError"
+FAIL org.w3.clearkey, temporary, keyids, invalid initdata (too long key ID) assert_equals: expected "TypeError" but got "NotAllowedError"
-FAIL Update with invalid Clear Key license assert_unreached: Error: NotSupportedError Reached unreachable code
+FAIL Update with invalid Clear Key license assert_unreached: Error: NotAllowedError Reached unreachable code
-CONSOLE MESSAGE: line 163: Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'contentitem.keys')
-FAIL Encrypted Media Extensions: Verify MediaKeySession.keyStatuses with multiple sessions, Clear Key undefined is not an object (evaluating 'contentitem.keys')
+FAIL org.w3.clearkey, temporary, keystatuses assert_unreached: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. Reached unreachable code
-CONSOLE MESSAGE: line 199: Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'contentitem.keys')
-FAIL Encrypted Media Extensions: Verify MediaKeySession.keyStatuses with multiple sessions, Clear Key undefined is not an object (evaluating 'contentitem.keys')
+FAIL org.w3.clearkey, temporary, keystatuses, multiple sessions assert_unreached: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. Reached unreachable code
-FAIL org.w3.clearkey, temporary, mp4, playback, single key, clear then encrypted content assert_unreached: NotSupportedError: The operation is not supported. Reached unreachable code
+FAIL org.w3.clearkey, temporary, mp4, playback, single key, clear then encrypted content assert_unreached: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. Reached unreachable code
-FAIL org.w3.clearkey, temporary, mp4, playback, single key, encrypted then clear content assert_unreached: NotSupportedError: The operation is not supported. Reached unreachable code
+FAIL org.w3.clearkey, temporary, mp4, playback, single key, encrypted then clear content assert_unreached: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. Reached unreachable code
-FAIL org.w3.clearkey, temporary, mp4, playback, encrypted and clear sources assert_unreached: NotSupportedError: The operation is not supported. Reached unreachable code
+FAIL org.w3.clearkey, temporary, mp4, playback, encrypted and clear sources assert_unreached: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. Reached unreachable code
-FAIL org.w3.clearkey, temporary, mp4, playback, check events assert_unreached: NotSupportedError: The operation is not supported. Reached unreachable code
+FAIL org.w3.clearkey, temporary, mp4, playback, check events assert_unreached: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. Reached unreachable code
-FAIL org.w3.clearkey, temporary, mp4, playback, single key assert_unreached: NotSupportedError: The operation is not supported. Reached unreachable code
+FAIL org.w3.clearkey, temporary, mp4, playback, single key assert_unreached: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. Reached unreachable code
-FAIL org.w3.clearkey, temporary, mp4, playback, multikey audio/video assert_unreached: NotSupportedError: The operation is not supported. Reached unreachable code
+FAIL org.w3.clearkey, temporary, mp4, playback, multikey audio/video assert_unreached: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. Reached unreachable code
-FAIL org.w3.clearkey, successful playback, temporary, mp4, multiple keys, sequential assert_unreached: NotSupportedError: The operation is not supported. Reached unreachable code
+FAIL org.w3.clearkey, successful playback, temporary, mp4, multiple keys, sequential assert_unreached: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. Reached unreachable code
-FAIL org.w3.clearkey, successful playback, temporary, mp4, multiple keys, sequential, readyState assert_unreached: NotSupportedError: The operation is not supported. Reached unreachable code
+FAIL org.w3.clearkey, successful playback, temporary, mp4, multiple keys, sequential, readyState assert_unreached: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. Reached unreachable code
-FAIL org.w3.clearkey, temporary, mp4, playback with multiple sessions, multikey video assert_unreached: NotSupportedError: The operation is not supported. Reached unreachable code
+FAIL org.w3.clearkey, temporary, mp4, playback with multiple sessions, multikey video assert_unreached: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. Reached unreachable code
-FAIL org.w3.clearkey, temporary, mp4, playback, setMediaKeys after setting video.src assert_unreached: NotSupportedError: The operation is not supported. Reached unreachable code
+FAIL org.w3.clearkey, temporary, mp4, playback, setMediaKeys after setting video.src assert_unreached: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. Reached unreachable code
-FAIL org.w3.clearkey, temporary, mp4, playback, setMediaKeys after updating session assert_unreached: NotSupportedError: The operation is not supported. Reached unreachable code
+FAIL org.w3.clearkey, temporary, mp4, playback, setMediaKeys after updating session assert_unreached: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. Reached unreachable code
-FAIL org.w3.clearkey, temporary, mp4, playback, setMediaKeys first assert_unreached: NotSupportedError: The operation is not supported. Reached unreachable code
+FAIL org.w3.clearkey, temporary, mp4, playback, setMediaKeys first assert_unreached: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. Reached unreachable code
-FAIL org.w3.clearkey, temporary, mp4, playback, setMediaKeys in encrypted event assert_unreached: NotSupportedError: The operation is not supported. Reached unreachable code
+FAIL org.w3.clearkey, temporary, mp4, playback, setMediaKeys in encrypted event assert_unreached: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. Reached unreachable code
-FAIL org.w3.clearkey, temporary, mp4, playback two videos assert_unreached: NotSupportedError: The operation is not supported. Reached unreachable code
+FAIL org.w3.clearkey, temporary, mp4, playback two videos assert_unreached: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. Reached unreachable code
-FAIL org.w3.clearkey, successful playback, temporary, mp4, waitingforkey event, 1 key assert_unreached: NotSupportedError: The operation is not supported. Reached unreachable code
+FAIL org.w3.clearkey, successful playback, temporary, mp4, waitingforkey event, 1 key assert_unreached: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. Reached unreachable code
PASS org.w3.clearkey, requestMediaKeySystemAccess: Key System name is case sensitive should result in NotSupportedError
PASS org.w3.clearkey, requestMediaKeySystemAccess: Empty supportedConfigurations should result in TypeError
PASS org.w3.clearkey, requestMediaKeySystemAccess: Empty configuration should result in NotSupportedError
-FAIL Basic supported configuration promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
-FAIL Partially supported configuration promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
-FAIL Supported audio codec promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
-FAIL ContentType formatting must be preserved promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
-PASS org.w3.clearkey, requestMediaKeySystemAccess: Unsupported audio codec ('audio/webm; codecs=fake') should result in NotSupportedError
-PASS org.w3.clearkey, requestMediaKeySystemAccess: Unsupported video codec () should result in NotSupportedError
-PASS org.w3.clearkey, requestMediaKeySystemAccess: Mismatched audio container/codec ('audio/webm; codecs=mp4a','audio/webm; codecs=mp4a.40.2') should result in NotSupportedError
-PASS org.w3.clearkey, requestMediaKeySystemAccess: Video codec specified in audio field ('video/mp4;codecs="avc1.4d401e"') should result in NotSupportedError
-PASS org.w3.clearkey, requestMediaKeySystemAccess: Audio codec specified in video field ('audio/mp4;codecs="mp4a.40.2"') should result in NotSupportedError
-PASS org.w3.clearkey, requestMediaKeySystemAccess: Mismatched audio container/codec ('audio/webm; codecs=avc1','audio/webm; codecs=avc1.42e01e') should result in NotSupportedError
-PASS org.w3.clearkey, requestMediaKeySystemAccess: Mismatched audio container/codec ('audio/mp4; codecs=vorbis') should result in NotSupportedError
-FAIL Two configurations, one supported promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
-FAIL Two configurations, both supported promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
-PASS org.w3.clearkey, requestMediaKeySystemAccess: Audio MIME type does not support video codecs (webm) ('audio/webm; codecs="vp8,vorbis"','audio/webm; codecs="vorbis, vp8"','audio/webm; codecs="vp8"') should result in NotSupportedError
-PASS org.w3.clearkey, requestMediaKeySystemAccess: Audio MIME type does not support video codecs (mp4) ('audio/mp4; codecs="avc1"','audio/mp4; codecs="avc1.4d401e"') should result in NotSupportedError
-PASS org.w3.clearkey, requestMediaKeySystemAccess: Video MIME type does not support audio codecs (webm) ('video/webm; codecs="vp8,vorbis"','video/webm; codecs="vorbis, vp8"','video/webm; codecs="vorbis"') should result in NotSupportedError
-PASS org.w3.clearkey, requestMediaKeySystemAccess: Video MIME type does not support audio codecs (mp4) ('video/mp4; codecs="mp4a"','video/mp4; codecs="mp4a.40.2"') should result in NotSupportedError
-PASS org.w3.clearkey, requestMediaKeySystemAccess: WebM audio does not support AVC1/AAC ('audio/webm; codecs="aac"','audio/webm; codecs="avc1"','audio/webm; codecs="vp8,aac"') should result in NotSupportedError
-PASS org.w3.clearkey, requestMediaKeySystemAccess: WebM video does not support AVC1/AAC ('video/webm; codecs="aac"','video/webm; codecs="avc1"','video/webm; codecs="vp8,aac"') should result in NotSupportedError
-FAIL Leading space in contentType promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
-FAIL Space before ; in contentType promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+PASS Basic supported configuration
+PASS Partially supported configuration
+PASS Supported audio codec
+PASS ContentType formatting must be preserved
+FAIL org.w3.clearkey, requestMediaKeySystemAccess: Unsupported audio codec ('audio/webm; codecs=fake') should result in NotSupportedError assert_unreached: Unexpected requestMediaKeySystemAccess() success. Reached unreachable code
+FAIL org.w3.clearkey, requestMediaKeySystemAccess: Unsupported video codec () should result in NotSupportedError assert_unreached: Unexpected requestMediaKeySystemAccess() success. Reached unreachable code
+FAIL org.w3.clearkey, requestMediaKeySystemAccess: Mismatched audio container/codec ('audio/webm; codecs=mp4a','audio/webm; codecs=mp4a.40.2') should result in NotSupportedError assert_unreached: Unexpected requestMediaKeySystemAccess() success. Reached unreachable code
+FAIL org.w3.clearkey, requestMediaKeySystemAccess: Video codec specified in audio field ('video/mp4;codecs="avc1.4d401e"') should result in NotSupportedError assert_unreached: Unexpected requestMediaKeySystemAccess() success. Reached unreachable code
+FAIL org.w3.clearkey, requestMediaKeySystemAccess: Audio codec specified in video field ('audio/mp4;codecs="mp4a.40.2"') should result in NotSupportedError assert_unreached: Unexpected requestMediaKeySystemAccess() success. Reached unreachable code
+FAIL org.w3.clearkey, requestMediaKeySystemAccess: Mismatched audio container/codec ('audio/webm; codecs=avc1','audio/webm; codecs=avc1.42e01e') should result in NotSupportedError assert_unreached: Unexpected requestMediaKeySystemAccess() success. Reached unreachable code
+FAIL org.w3.clearkey, requestMediaKeySystemAccess: Mismatched audio container/codec ('audio/mp4; codecs=vorbis') should result in NotSupportedError assert_unreached: Unexpected requestMediaKeySystemAccess() success. Reached unreachable code
+PASS Two configurations, one supported
+PASS Two configurations, both supported
+FAIL org.w3.clearkey, requestMediaKeySystemAccess: Audio MIME type does not support video codecs (webm) ('audio/webm; codecs="vp8,vorbis"','audio/webm; codecs="vorbis, vp8"','audio/webm; codecs="vp8"') should result in NotSupportedError assert_unreached: Unexpected requestMediaKeySystemAccess() success. Reached unreachable code
+FAIL org.w3.clearkey, requestMediaKeySystemAccess: Audio MIME type does not support video codecs (mp4) ('audio/mp4; codecs="avc1"','audio/mp4; codecs="avc1.4d401e"') should result in NotSupportedError assert_unreached: Unexpected requestMediaKeySystemAccess() success. Reached unreachable code
+FAIL org.w3.clearkey, requestMediaKeySystemAccess: Video MIME type does not support audio codecs (webm) ('video/webm; codecs="vp8,vorbis"','video/webm; codecs="vorbis, vp8"','video/webm; codecs="vorbis"') should result in NotSupportedError assert_unreached: Unexpected requestMediaKeySystemAccess() success. Reached unreachable code
+FAIL org.w3.clearkey, requestMediaKeySystemAccess: Video MIME type does not support audio codecs (mp4) ('video/mp4; codecs="mp4a"','video/mp4; codecs="mp4a.40.2"') should result in NotSupportedError assert_unreached: Unexpected requestMediaKeySystemAccess() success. Reached unreachable code
+FAIL org.w3.clearkey, requestMediaKeySystemAccess: WebM audio does not support AVC1/AAC ('audio/webm; codecs="aac"','audio/webm; codecs="avc1"','audio/webm; codecs="vp8,aac"') should result in NotSupportedError assert_unreached: Unexpected requestMediaKeySystemAccess() success. Reached unreachable code
+FAIL org.w3.clearkey, requestMediaKeySystemAccess: WebM video does not support AVC1/AAC ('video/webm; codecs="aac"','video/webm; codecs="avc1"','video/webm; codecs="vp8,aac"') should result in NotSupportedError assert_unreached: Unexpected requestMediaKeySystemAccess() success. Reached unreachable code
+PASS Leading space in contentType
+PASS Space before ; in contentType
FAIL Trailing space in contentType promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
-FAIL Space at start of codecs parameter promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
-FAIL Space at end of codecs parameter promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
-FAIL Video/ promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+PASS Space at start of codecs parameter
+PASS Space at end of codecs parameter
+PASS Video/
FAIL Codecs= promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
-FAIL Upper case MIME type promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+PASS Upper case MIME type
FAIL CODECS= promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
PASS org.w3.clearkey, requestMediaKeySystemAccess: Unrecognized foo with webm ('video/webm; foo="bar"') should result in NotSupportedError
PASS org.w3.clearkey, requestMediaKeySystemAccess: Unrecognized foo with mp4 ('video/mp4; foo="bar"') should result in NotSupportedError
PASS org.w3.clearkey, requestMediaKeySystemAccess: contentType: 'fake' should result in NotSupportedError
PASS org.w3.clearkey, requestMediaKeySystemAccess: contentType: 'audio/fake' should result in NotSupportedError
PASS org.w3.clearkey, requestMediaKeySystemAccess: contentType: 'video/fake' should result in NotSupportedError
-PASS org.w3.clearkey, requestMediaKeySystemAccess: contentType: 'video/mp4;codecs="AVC1.4D401E"' should result in NotSupportedError
-PASS org.w3.clearkey, requestMediaKeySystemAccess: contentType: 'video/mp4;codecs=",avc1.4d401e"' should result in NotSupportedError
+FAIL org.w3.clearkey, requestMediaKeySystemAccess: contentType: 'video/mp4;codecs="AVC1.4D401E"' should result in NotSupportedError assert_unreached: Unexpected requestMediaKeySystemAccess() success. Reached unreachable code
+FAIL org.w3.clearkey, requestMediaKeySystemAccess: contentType: 'video/mp4;codecs=",avc1.4d401e"' should result in NotSupportedError assert_unreached: Unexpected requestMediaKeySystemAccess() success. Reached unreachable code
-FAIL Reset src after setMediaKeys(). assert_unreached: NotSupportedError: The operation is not supported. Reached unreachable code
+FAIL Reset src after setMediaKeys(). assert_unreached: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. Reached unreachable code
-PASS org.w3.clearkey, setmediakeys again after playback
+FAIL org.w3.clearkey, setmediakeys again after playback assert_in_array: value "NotAllowedError" not in array ["InvalidStateError", "NotSupportedError"]
-FAIL org.w3.clearkey, setmediakeys again after resetting src assert_unreached: NotSupportedError: The operation is not supported. Reached unreachable code
+FAIL org.w3.clearkey, setmediakeys again after resetting src assert_unreached: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. Reached unreachable code
-CONSOLE MESSAGE: line 272: Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'contentitem.audio')
-FAIL Encrypted Media Extensions: setMediaKeys multiple at same time with Clear Key undefined is not an object (evaluating 'contentitem.audio')
+FAIL org.w3.clearkey, setmediakeys at same time assert_unreached: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. Reached unreachable code
-CONSOLE MESSAGE: line 272: Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'contentitem.audio')
-FAIL Encrypted Media Extensions: setMediaKeys with Clear Key undefined is not an object (evaluating 'contentitem.audio')
+Harness Error (TIMEOUT), message = null
+
+TIMEOUT org.w3.clearkey, setMediaKeys Test timed out
-FAIL org.w3.clearkey, setmediakeys multiple times with the same mediakeys assert_unreached: NotSupportedError: The operation is not supported. Reached unreachable code
+FAIL org.w3.clearkey, setmediakeys multiple times with the same mediakeys assert_unreached: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. Reached unreachable code
-CONSOLE MESSAGE: line 272: Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'contentitem.audio')
-FAIL Encrypted Media Extensions: setMediaKeys to multiple video elements with Clear Key undefined is not an object (evaluating 'contentitem.audio')
+FAIL org.w3.clearkey, setMediaKeys to multiple video elements assert_unreached: Error: assert_equals: expected "QuotaExceededError" but got "NotAllowedError" Reached unreachable code
-FAIL org.w3.clearkey test MediaKeys attribute syntax assert_true: initDataType should be supported expected true got false
-FAIL org.w3.clearkey test MediaKeys setServerCertificate() exceptions. assert_true: initDataType not supported expected true got false
-FAIL org.w3.clearkey test MediaKeys setServerCertificate() syntax with non-empty certificate. assert_true: initDataType not supported expected true got false
+FAIL org.w3.clearkey test MediaKeys attribute syntax promise_test: Unhandled rejection with value: object "NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission."
+FAIL org.w3.clearkey test MediaKeys setServerCertificate() exceptions. promise_test: Unhandled rejection with value: object "NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission."
+FAIL org.w3.clearkey test MediaKeys setServerCertificate() syntax with non-empty certificate. promise_test: Unhandled rejection with value: object "NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission."
-FAIL org.w3.clearkey test MediaKeySession generateRequest() exceptions. assert_true: initDataType not supported expected true got false
-FAIL org.w3.clearkey test MediaKeySession load() exceptions. assert_true: initDataType not supported expected true got false
-FAIL org.w3.clearkey test if MediaKeySession generateRequest() resolves for various sessions assert_true: initDataType should be supported expected true got false
-FAIL org.w3.clearkey test MediaKeySession update() exceptions. assert_true: initDataType not supported expected true got false
-FAIL org.w3.clearkey test MediaKeySession close() exceptions. assert_true: initDataType not supported expected true got false
-FAIL org.w3.clearkey test MediaKeySession remove() exceptions. assert_true: initDataType not supported expected true got false
-FAIL org.w3.clearkey test MediaKeySession attribute syntax. assert_true: initDataType not supported expected true got false
+FAIL org.w3.clearkey test MediaKeySession generateRequest() exceptions. promise_test: Unhandled rejection with value: object "NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission."
+FAIL org.w3.clearkey test MediaKeySession load() exceptions. promise_test: Unhandled rejection with value: object "NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission."
+FAIL org.w3.clearkey test if MediaKeySession generateRequest() resolves for various sessions promise_test: Unhandled rejection with value: object "NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission."
+FAIL org.w3.clearkey test MediaKeySession update() exceptions. promise_test: Unhandled rejection with value: object "NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission."
+FAIL org.w3.clearkey test MediaKeySession close() exceptions. promise_test: Unhandled rejection with value: object "NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission."
+FAIL org.w3.clearkey test MediaKeySession remove() exceptions. promise_test: Unhandled rejection with value: object "NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission."
+FAIL org.w3.clearkey test MediaKeySession attribute syntax. promise_test: Unhandled rejection with value: object "NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission."
PASS org.w3.clearkey test requestMediaKeySystemAccess() exceptions.
-FAIL org.w3.clearkey test MediaKeySystemAccess attribute syntax. assert_true: initDataType not supported expected true got false
+PASS org.w3.clearkey test MediaKeySystemAccess attribute syntax.
-FAIL update() with invalid response (longer than 64Kb characters) should fail. assert_equals: expected "TypeError" but got "NotSupportedError"
+FAIL update() with invalid response (longer than 64Kb characters) should fail. assert_equals: expected "TypeError" but got "NotAllowedError"
-FAIL Waiting for a key. assert_unreached: Error: NotSupportedError Reached unreachable code
+FAIL Waiting for a key. assert_unreached: Error: NotAllowedError Reached unreachable code
-FAIL org.w3.clearkey, temporary, update() immediately after createSession() promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
-FAIL org.w3.clearkey, temporary, close() immediately after createSession() promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
-FAIL org.w3.clearkey, temporary, remove() immediately after createSession() promise_test: Unhandled rejection with value: object "NotSupportedError: The operation is not supported."
+FAIL org.w3.clearkey, temporary, update() immediately after createSession() promise_test: Unhandled rejection with value: object "NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission."
+FAIL org.w3.clearkey, temporary, close() immediately after createSession() promise_test: Unhandled rejection with value: object "NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission."
+FAIL org.w3.clearkey, temporary, remove() immediately after createSession() promise_test: Unhandled rejection with value: object "NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission."
-FAIL org.w3.clearkey test handling of non-ASCII responses for update() assert_unreached: Error: NotSupportedError Reached unreachable code
+FAIL org.w3.clearkey test handling of non-ASCII responses for update() assert_unreached: Error: NotAllowedError Reached unreachable code
+2017-08-04 Zan Dobersek <zdobersek@igalia.com>
+
+ [EME][GStreamer] Register ClearKey CDMFactory
+ https://bugs.webkit.org/show_bug.cgi?id=175136
+
+ Reviewed by Xabier Rodriguez-Calvar.
+
+ Register the ClearKey CDM factory in CDMFactoryGStreamer. A CDMFactoryClearKey
+ singleton object is introduced and used for that registration.
+
+ The basic CDMFactoryClearKey and CDMPrivateClearKey methods are implemented,
+ marking `org.w3.clearkey` as the supported key system and `keyids` as the
+ supported init data type. Additional logic around key system configurations,
+ distinctive identifiers, persistent state and related restrictions and
+ requirements is implemented.
+
+ This improves the ClearKey EME tests a bit, now progressing to the point of
+ failing with a NotAllowedError exception due to the CDMInstance object failing
+ to properly initialize because of missing implementation.
+
+ No new tests -- relevant tests have underlying baselines updated to reflect
+ changes in behavior.
+
+ * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
+ (WebCore::CDMFactoryClearKey::singleton):
+ (WebCore::CDMFactoryClearKey::supportsKeySystem):
+ (WebCore::CDMPrivateClearKey::supportsInitDataType const):
+ (WebCore::CDMPrivateClearKey::supportsConfiguration const):
+ (WebCore::CDMPrivateClearKey::supportsConfigurationWithRestrictions const):
+ (WebCore::CDMPrivateClearKey::supportsSessionTypeWithConfiguration const):
+ (WebCore::CDMPrivateClearKey::supportsRobustness const):
+ (WebCore::CDMPrivateClearKey::distinctiveIdentifiersRequirement const):
+ (WebCore::CDMPrivateClearKey::persistentStateRequirement const):
+ * platform/encryptedmedia/clearkey/CDMClearKey.h:
+ * platform/graphics/gstreamer/eme/CDMFactoryGStreamer.cpp:
+ (WebCore::CDMFactory::platformRegisterFactories):
+
2017-08-04 John Wilander <wilander@apple.com>
Resource Load Statistics: Report user interaction immediately, but only when needed
#if ENABLE(ENCRYPTED_MEDIA)
+#include "CDMKeySystemConfiguration.h"
+#include "CDMRestrictions.h"
+#include "CDMSessionType.h"
#include "SharedBuffer.h"
namespace WebCore {
+CDMFactoryClearKey& CDMFactoryClearKey::singleton()
+{
+ static CDMFactoryClearKey s_factory;
+ return s_factory;
+}
+
CDMFactoryClearKey::CDMFactoryClearKey() = default;
CDMFactoryClearKey::~CDMFactoryClearKey() = default;
return std::unique_ptr<CDMPrivate>(new CDMPrivateClearKey);
}
-bool CDMFactoryClearKey::supportsKeySystem(const String&)
+bool CDMFactoryClearKey::supportsKeySystem(const String& keySystem)
{
- return false;
+ // `org.w3.clearkey` is the only supported key system.
+ return equalLettersIgnoringASCIICase(keySystem, "org.w3.clearkey");
}
CDMPrivateClearKey::CDMPrivateClearKey() = default;
CDMPrivateClearKey::~CDMPrivateClearKey() = default;
-bool CDMPrivateClearKey::supportsInitDataType(const AtomicString&) const
+bool CDMPrivateClearKey::supportsInitDataType(const AtomicString& initDataType) const
{
- return false;
+ // `keyids` is the only supported init data type.
+ return equalLettersIgnoringASCIICase(initDataType, "keyids");
}
-bool CDMPrivateClearKey::supportsConfiguration(const CDMKeySystemConfiguration&) const
+bool CDMPrivateClearKey::supportsConfiguration(const CDMKeySystemConfiguration& configuration) const
{
- return false;
+ // Reject any configuration that marks distinctive identifier or persistent state as required.
+ if (configuration.distinctiveIdentifier == CDMRequirement::Required
+ || configuration.persistentState == CDMRequirement::Required)
+ return false;
+ return true;
}
-bool CDMPrivateClearKey::supportsConfigurationWithRestrictions(const CDMKeySystemConfiguration&, const CDMRestrictions&) const
+bool CDMPrivateClearKey::supportsConfigurationWithRestrictions(const CDMKeySystemConfiguration& configuration, const CDMRestrictions& restrictions) const
{
- return false;
+ // Reject any configuration that marks distincitive identifier as required, or that marks
+ // distinctive identifier as optional even when restrictions mark it as denied.
+ if ((configuration.distinctiveIdentifier == CDMRequirement::Optional && restrictions.distinctiveIdentifierDenied)
+ || configuration.distinctiveIdentifier == CDMRequirement::Required)
+ return false;
+
+ // Ditto for persistent state.
+ if ((configuration.persistentState == CDMRequirement::Optional && restrictions.persistentStateDenied)
+ || configuration.persistentState == CDMRequirement::Required)
+ return false;
+
+ return true;
}
-bool CDMPrivateClearKey::supportsSessionTypeWithConfiguration(CDMSessionType&, const CDMKeySystemConfiguration&) const
+bool CDMPrivateClearKey::supportsSessionTypeWithConfiguration(CDMSessionType& sessionType, const CDMKeySystemConfiguration& configuration) const
{
- return false;
+ // Only support the temporary session type.
+ if (sessionType != CDMSessionType::Temporary)
+ return false;
+ return supportsConfiguration(configuration);
}
-bool CDMPrivateClearKey::supportsRobustness(const String&) const
+bool CDMPrivateClearKey::supportsRobustness(const String& robustness) const
{
- return false;
+ // Only empty `robustness` string is supported.
+ return robustness.isEmpty();
}
-CDMRequirement CDMPrivateClearKey::distinctiveIdentifiersRequirement(const CDMKeySystemConfiguration&, const CDMRestrictions&) const
+CDMRequirement CDMPrivateClearKey::distinctiveIdentifiersRequirement(const CDMKeySystemConfiguration&, const CDMRestrictions& restrictions) const
{
+ // Distinctive identifier is not allowed if it's been denied, otherwise it's optional.
+ if (restrictions.distinctiveIdentifierDenied)
+ return CDMRequirement::NotAllowed;
return CDMRequirement::Optional;
}
-CDMRequirement CDMPrivateClearKey::persistentStateRequirement(const CDMKeySystemConfiguration&, const CDMRestrictions&) const
+CDMRequirement CDMPrivateClearKey::persistentStateRequirement(const CDMKeySystemConfiguration&, const CDMRestrictions& restrictions) const
{
+ // Persistent state is not allowed if it's been denied, otherwise it's optional.
+ if (restrictions.persistentStateDenied)
+ return CDMRequirement::NotAllowed;
return CDMRequirement::Optional;
}
class CDMFactoryClearKey final : public CDMFactory {
public:
- CDMFactoryClearKey();
+ static CDMFactoryClearKey& singleton();
+
virtual ~CDMFactoryClearKey();
std::unique_ptr<CDMPrivate> createCDM() override;
bool supportsKeySystem(const String&) override;
+
+private:
+ CDMFactoryClearKey();
};
class CDMPrivateClearKey final : public CDMPrivate {
#if ENABLE(ENCRYPTED_MEDIA)
+#include "CDMClearKey.h"
+
namespace WebCore {
void CDMFactory::platformRegisterFactories(Vector<CDMFactory*>& factories)
{
+ factories.append(&CDMFactoryClearKey::singleton());
}
} // namespace WebCore