Import W3C EME tests
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Oct 2016 06:08:59 +0000 (06:08 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Oct 2016 06:08:59 +0000 (06:08 +0000)
https://bugs.webkit.org/show_bug.cgi?id=163214

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Import the W3C EME tests from the web-platform-tests repository on GitHub.
The import was done via the import-w3c-tests script.

All the tests are still missing baselines, and they're skipped on all platforms.
The baselines will be added incrementally as the implementation grows. The idlharness.html
test will be unskipped first when the navigator.requestMediaKeySystemAccess() is added.

* resources/ImportExpectations: Skip Google EME tests.
* web-platform-tests/encrypted-media/: Added. The file list is omitted for clarity.

LayoutTests:

Skip the newly-imported W3C EME tests on all platforms.

* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:
* tests-options.json:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207660 268f45cc-cd09-0410-ab3c-d52691b4dbfc

190 files changed:
LayoutTests/ChangeLog
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/resources/ImportExpectations
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/EncryptedMediaExtensions.idl [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/OWNERS [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/README.md [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-check-initdata-type.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-events-session-closed-event.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-events.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-generate-request-disallowed-input.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-invalid-license.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-keystatuses-multiple-sessions.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-keystatuses.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-destroy-persistent-license.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-persistent-license-events.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-persistent-license.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-persistent-usage-record-events.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-persistent-usage-record.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-destroy-persistent-license.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-persistent-license.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-persistent-usage-record.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-clear-encrypted.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-encrypted-clear-sources.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-encrypted-clear.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-events.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-sequential-readyState.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-sequential.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multisession.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-after-src.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-after-update.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-immediately.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-onencrypted.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-two-videos.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-requestmediakeysystemaccess.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-reset-src-after-setmediakeys.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-again-after-playback.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-again-after-resetting-src.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-at-same-time.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-multiple-times-with-different-mediakeys.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-multiple-times-with-the-same-mediakeys.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-to-multiple-video-elements.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-syntax-mediakeys.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-syntax-mediakeysession.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-syntax-mediakeysystemaccess.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-unique-origin.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-update-disallowed-input.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-waiting-for-a-key.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-not-callable-after-createsession.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-update-non-ascii-input.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/audio_aac-lc_128k_2keys_2sess.mp4 [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/audio_aac-lc_128k_dashinit.mp4 [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/audio_aac-lc_128k_enc_dashinit.mp4 [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/content-metadata.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_clear_dashinit.mp4 [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_clear_enc_dashinit.mp4 [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_dashinit.mp4 [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_enc_2keys_2sess.mp4 [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_enc_clear_dashinit.mp4 [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_enc_dashinit.mp4 [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_multikey_dashinit.mp4 [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_multikey_key2_dashinit.mp4 [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/w3c-import.log [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-check-initdata-type.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-events-session-closed-event.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-events.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-expiration.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-generate-request-disallowed-input.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-invalid-license.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-keystatuses-multiple-sessions.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-keystatuses.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-onencrypted.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-destroy-persistent-license.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-persistent-license-events.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-persistent-license.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-persistent-usage-record-events.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-persistent-usage-record.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-retrieve-destroy-persistent-license.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-retrieve-persistent-license.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-retrieve-persistent-usage-record.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-clear-encrypted.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-encrypted-clear-sources.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-encrypted-clear.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-events.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-expired.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-multikey-sequential-readyState.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-multikey-sequential.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-multikey.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-multisession.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-setMediaKeys-after-src.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-setMediaKeys-after-update.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-setMediaKeys-immediately.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-setMediaKeys-onencrypted.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-two-videos.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-waitingforkey.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-requestmediakeysystemaccess.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-reset-src-after-setmediakeys.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-setmediakeys-again-after-playback.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-setmediakeys-again-after-resetting-src.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-setmediakeys-at-same-time.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-setmediakeys-multiple-times-with-different-mediakeys.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-setmediakeys-multiple-times-with-the-same-mediakeys.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-setmediakeys-to-multiple-video-elements.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-setmediakeys.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-syntax-mediakeys.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-syntax-mediakeysession.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-syntax-mediakeysystemaccess.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-unique-origin.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-waiting-for-a-key.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-not-callable-after-createsession.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-temporary-license-type.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/idlharness.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/polyfill/cast-polyfill.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/polyfill/chrome-polyfill.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/polyfill/clearkey-polyfill.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/polyfill/edge-keystatuses.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/polyfill/edge-persistent-usage-record.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/polyfill/firefox-polyfill.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/polyfill/make-polyfill-tests.py [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/polyfill/w3c-import.log [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/resources/clearkey-retrieve-destroy-persistent-license.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/resources/clearkey-retrieve-persistent-license.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/resources/drm-retrieve-destroy-persistent-license.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/resources/drm-retrieve-persistent-license.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/resources/drm-retrieve-persistent-usage-record.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/resources/retrieve-persistent-usage-record.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/resources/w3c-import.log [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/check-initdata-type.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/clearkey-update-non-ascii-input.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/events-session-closed-event.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/events.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/expiration.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/generate-request-disallowed-input.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/invalid-license.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/keystatuses-multiple-sessions.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/keystatuses.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/not-callable-after-createsession.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/onencrypted.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/playback-destroy-persistent-license.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/playback-persistent-license-events.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/playback-persistent-license.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/playback-persistent-usage-record-events.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/playback-persistent-usage-record.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/playback-retrieve-persistent-license.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/playback-retrieve-persistent-usage-record.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/playback-temporary-encrypted-clear-sources.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/playback-temporary-events.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/playback-temporary-expired.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/playback-temporary-multikey-multisession.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/playback-temporary-multikey-sequential.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/playback-temporary-multisession.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/playback-temporary-setMediaKeys.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/playback-temporary-two-videos.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/playback-temporary-waitingforkey.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/playback-temporary.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/requestmediakeysystemaccess.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/reset-src-after-setmediakeys.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/setmediakeys-again-after-playback.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/setmediakeys-again-after-resetting-src.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/setmediakeys-at-same-time.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/setmediakeys-multiple-times-with-different-mediakeys.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/setmediakeys-multiple-times-with-the-same-mediakeys.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/setmediakeys-to-multiple-video-elements.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/setmediakeys.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/syntax-mediakeys.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/syntax-mediakeysession.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/syntax-mediakeysystemaccess.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/temporary-license-type.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/unique-origin.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/update-disallowed-input.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/w3c-import.log [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/scripts/waiting-for-a-key.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/util/clearkey-messagehandler.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/util/drm-messagehandler.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/util/fetch.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/util/testmediasource.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/util/utf8.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/util/utils.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/util/w3c-import.log [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/encrypted-media/w3c-import.log [new file with mode: 0644]
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/ios-simulator/TestExpectations
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/win/TestExpectations
LayoutTests/tests-options.json

index 25f8788..a1d5329 100644 (file)
@@ -1,3 +1,19 @@
+2016-10-20  Zan Dobersek  <zdobersek@igalia.com>
+
+        Import W3C EME tests
+        https://bugs.webkit.org/show_bug.cgi?id=163214
+
+        Reviewed by Youenn Fablet.
+
+        Skip the newly-imported W3C EME tests on all platforms.
+
+        * platform/efl/TestExpectations:
+        * platform/gtk/TestExpectations:
+        * platform/ios-simulator/TestExpectations:
+        * platform/mac/TestExpectations:
+        * platform/win/TestExpectations:
+        * tests-options.json:
+
 2016-10-20  Yusuke Suzuki  <utatane.tea@gmail.com>
 
         [JSC] Drop isEnvironmentRecord type info flag and use JSType information instead
index 5525e81..3a87d2d 100644 (file)
@@ -1,3 +1,20 @@
+2016-10-20  Zan Dobersek  <zdobersek@igalia.com>
+
+        Import W3C EME tests
+        https://bugs.webkit.org/show_bug.cgi?id=163214
+
+        Reviewed by Youenn Fablet.
+
+        Import the W3C EME tests from the web-platform-tests repository on GitHub.
+        The import was done via the import-w3c-tests script.
+
+        All the tests are still missing baselines, and they're skipped on all platforms.
+        The baselines will be added incrementally as the implementation grows. The idlharness.html
+        test will be unskipped first when the navigator.requestMediaKeySystemAccess() is added.
+
+        * resources/ImportExpectations: Skip Google EME tests.
+        * web-platform-tests/encrypted-media/: Added. The file list is omitted for clarity.
+
 2016-10-20  Brady Eidson  <beidson@apple.com>
 
         IndexedDB 2.0: Support IDBObjectStore name assignment.
index 74ce06e..9914ec7 100644 (file)
@@ -148,7 +148,8 @@ web-platform-tests/domparsing/style_attribute_html.html [ Skip ]
 web-platform-tests/domxpath [ Skip ]
 web-platform-tests/editing [ Skip ]
 web-platform-tests/encoding [ Skip ]
-web-platform-tests/encrypted-media [ Skip ]
+#web-platform-tests/encrypted-media [ Pass ]
+web-platform-tests/encrypted-media/Google [ Skip ]
 web-platform-tests/eventsource [ Skip ]
 web-platform-tests/ext-xhtml-pubid [ Skip ]
 #web-platform-tests/fetch [ Pass ]
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/EncryptedMediaExtensions.idl b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/EncryptedMediaExtensions.idl
new file mode 100644 (file)
index 0000000..fbe898b
--- /dev/null
@@ -0,0 +1,119 @@
+// Encrypted Media Extensions WebIDL
+//
+// NOTE: Please update the link below to the specification version from
+//       which this IDL was extracted.
+//
+// https://www.w3.org/TR/2016/WD-encrypted-media-20160610/
+//  + commit 5499821932391ae2c2e53756ae7ab9fae89d5863
+//
+
+partial interface Navigator {
+    Promise<MediaKeySystemAccess> requestMediaKeySystemAccess (DOMString keySystem, sequence<MediaKeySystemConfiguration> supportedConfigurations);
+};
+
+enum MediaKeysRequirement {
+    "required",
+    "optional",
+    "not-allowed"
+};
+
+dictionary MediaKeySystemConfiguration {
+             DOMString                               label = "";
+             sequence<DOMString>                     initDataTypes = [];
+             sequence<MediaKeySystemMediaCapability> audioCapabilities = [];
+             sequence<MediaKeySystemMediaCapability> videoCapabilities = [];
+             MediaKeysRequirement                    distinctiveIdentifier = "optional";
+             MediaKeysRequirement                    persistentState = "optional";
+             sequence<DOMString>                     sessionTypes;
+};
+
+dictionary MediaKeySystemMediaCapability {
+             DOMString contentType = "";
+             DOMString robustness = "";
+};
+
+interface MediaKeySystemAccess {
+    readonly        attribute DOMString keySystem;
+    MediaKeySystemConfiguration getConfiguration ();
+    Promise<MediaKeys>          createMediaKeys ();
+};
+
+enum MediaKeySessionType {
+    "temporary",
+    "persistent-usage-record",
+    "persistent-license"
+};
+
+interface MediaKeys {
+    MediaKeySession  createSession (optional MediaKeySessionType sessionType = "temporary");
+    Promise<boolean> setServerCertificate (BufferSource serverCertificate);
+};
+
+interface MediaKeySession : EventTarget {
+    readonly        attribute DOMString           sessionId;
+    readonly        attribute unrestricted double expiration;
+    readonly        attribute Promise<void>       closed;
+    readonly        attribute MediaKeyStatusMap   keyStatuses;
+                    attribute EventHandler        onkeystatuseschange;
+                    attribute EventHandler        onmessage;
+    Promise<void>    generateRequest (DOMString initDataType, BufferSource initData);
+    Promise<boolean> load (DOMString sessionId);
+    Promise<void>    update (BufferSource response);
+    Promise<void>    close ();
+    Promise<void>    remove ();
+};
+
+interface MediaKeyStatusMap {
+    iterable<BufferSource,MediaKeyStatus>;
+    readonly        attribute unsigned long size;
+    boolean has (BufferSource keyId);
+    any     get (BufferSource keyId);
+};
+
+enum MediaKeyStatus {
+    "usable",
+    "expired",
+    "released",
+    "output-restricted",
+    "output-downscaled",
+    "status-pending",
+    "internal-error"
+};
+
+enum MediaKeyMessageType {
+    "license-request",
+    "license-renewal",
+    "license-release",
+    "individualization-request"
+};
+
+[Constructor(DOMString type, MediaKeyMessageEventInit eventInitDict)]
+interface MediaKeyMessageEvent : Event {
+    readonly        attribute MediaKeyMessageType messageType;
+    readonly        attribute ArrayBuffer         message;
+};
+
+dictionary MediaKeyMessageEventInit : EventInit {
+             required MediaKeyMessageType messageType;
+             required ArrayBuffer         message;
+};
+
+// partial interface HTMLMediaElement : EventTarget {
+partial interface HTMLMediaElement {
+    readonly        attribute MediaKeys?   mediaKeys;
+                    attribute EventHandler onencrypted;
+                    attribute EventHandler onwaitingforkey;
+    Promise<void> setMediaKeys (MediaKeys? mediaKeys);
+};
+
+[Constructor(DOMString type, optional MediaEncryptedEventInit eventInitDict)]
+interface MediaEncryptedEvent : Event {
+    readonly        attribute DOMString    initDataType;
+    readonly        attribute ArrayBuffer? initData;
+};
+
+dictionary MediaEncryptedEventInit : EventInit {
+             DOMString    initDataType = "";
+             ArrayBuffer? initData = null;
+};
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/OWNERS b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/OWNERS
new file mode 100644 (file)
index 0000000..63b5fe2
--- /dev/null
@@ -0,0 +1 @@
+@ddorwin
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/README.md b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/README.md
new file mode 100644 (file)
index 0000000..932c996
--- /dev/null
@@ -0,0 +1,7 @@
+## Preparing to run tests
+The following steps may be necessary when running test from a new server/origin for the first time.
+* Some implementations and/or tests may require consent.
+  When running on such clients, manually run a test to trigger the consent request and choose to persist the consent.
+* Some of the tests, such as *-retrieve-*, use pop-ups.
+  It may be necessary to run these tests manually and choose to always allow pop-ups on the origin.
+  Related test failures may appear as: "Cannot set property 'onload' of undefined"
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-check-initdata-type.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-check-initdata-type.html
new file mode 100644 (file)
index 0000000..395ccd2
--- /dev/null
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with Clear Key, mp4</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-initdata-type.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <script>
+        var config = {  keysystem: 'org.w3.clearkey' }
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-events-session-closed-event.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-events-session-closed-event.html
new file mode 100644 (file)
index 0000000..f994b48
--- /dev/null
@@ -0,0 +1,40 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions - Test MediaKeySession closed event with Clear Key, mp4</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/events-session-closed-event.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <script>
+        var keysystem = 'org.w3.clearkey',
+            contentItem = content['mp4-basic'],
+            config = {
+                keysystem: keysystem,
+                content: contentItem,
+                initDataType: 'keyids',
+                initData: getInitData(contentItem,'keyids'),
+                audioType: contentItem.audio.type,
+                videoType: contentItem.video.type
+            };
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-events.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-events.html
new file mode 100644 (file)
index 0000000..5064066
--- /dev/null
@@ -0,0 +1,44 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Events 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>
+    <script src=/encrypted-media/util/fetch.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/events.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <script>
+        getSupportedContent( 'org.w3.clearkey' )
+        .then( function( contents )
+        {
+            var content = contents.filter(function(content) { return content.keys; })[0],
+                handler = new MessageHandler( 'org.w3.clearkey', content );
+
+            runTest( {  keysystem:          'org.w3.clearkey',
+                        content:            content,
+                        messagehandler:     handler.messagehandler,
+                     } );
+        } );
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-generate-request-disallowed-input.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-generate-request-disallowed-input.html
new file mode 100644 (file)
index 0000000..cbcdad4
--- /dev/null
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Test handling of invalid initData for generateRequest()</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>
+    <script src=/encrypted-media/util/fetch.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/generate-request-disallowed-input.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <script>
+        var config = {  keysystem:          'org.w3.clearkey'
+                     };
+
+        runTest(config);
+
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-invalid-license.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-invalid-license.html
new file mode 100644 (file)
index 0000000..47d2c54
--- /dev/null
@@ -0,0 +1,31 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Test handling of invalid Clear Key license</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>
+    <script src=/encrypted-media/util/fetch.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/invalid-license.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <script>
+        var config = {
+            keysystem: 'org.w3.clearkey'
+        };
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-keystatuses-multiple-sessions.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-keystatuses-multiple-sessions.html
new file mode 100644 (file)
index 0000000..886f965
--- /dev/null
@@ -0,0 +1,51 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Verify MediaKeySession.keyStatuses with multiple sessions, 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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/keystatuses-multiple-sessions.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <script>
+        getSupportedContent( 'org.w3.clearkey' )
+        .then( function( contents ) {
+
+            // Select a content item with multiple keys
+            var contentitem = contents.filter( function( item ) { return item.keys && item.keys.length > 1; } )[ 0 ],
+                handler = new MessageHandler( 'org.w3.clearkey', contentitem );
+
+            var config = {  keysystem:          'org.w3.clearkey',
+                            content:            contentitem,
+                            messagehandler:     handler.messagehandler,
+                            initDataType:       'keyids',
+                            initData:           getMultikeyInitDatas(contentitem,'keyids')
+                        };
+
+            runTest(config);
+
+        } );
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-keystatuses.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-keystatuses.html
new file mode 100644 (file)
index 0000000..d3e8e0e
--- /dev/null
@@ -0,0 +1,50 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Verify MediaKeySession.keyStatuses with multiple sessions, 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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/keystatuses.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <script>
+        getSupportedContent( 'org.w3.clearkey' )
+        .then( function( contents ) {
+
+            // Select a content item with multiple keys
+            var contentitem = contents.filter( function( item ) { return item.keys && item.keys.length > 1; } )[ 0 ];
+            var handler = new MessageHandler( 'org.w3.clearkey', contentitem );
+            var config = {  keysystem:          'org.w3.clearkey',
+                            content:            contentitem,
+                            messagehandler:     handler.messagehandler,
+                            initDataType:       'keyids',
+                            initData:           getInitData(contentitem,'keyids')
+                        };
+
+            runTest(config);
+
+        } );
+    </script>
+  </body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-destroy-persistent-license.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-destroy-persistent-license.html
new file mode 100644 (file)
index 0000000..c3e03bc
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: persistent-license, playback, destroy license with Clear Key, mp4</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-destroy-persistent-license.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-basic'],
+            handler = new MessageHandler( 'org.w3.clearkey', contentitem ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       'keyids',
+                        initData:           getInitData(contentitem,'keyids')
+                    };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-persistent-license-events.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-persistent-license-events.html
new file mode 100644 (file)
index 0000000..b1398d5
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, persistent-license session with Clear Key, mp4, event sequence</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-persistent-license-events.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-basic'],
+            handler = new MessageHandler( 'org.w3.clearkey', contentitem ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       'keyids',
+                        initData:           getInitData(contentitem,'keyids')
+                    };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-persistent-license.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-persistent-license.html
new file mode 100644 (file)
index 0000000..f2e7ac6
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, persistent-license session with Clear Key, mp4</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-persistent-license.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-basic'],
+            handler = new MessageHandler( 'org.w3.clearkey', contentitem ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       'keyids',
+                        initData:           getInitData(contentitem,'keyids')
+                       };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-persistent-usage-record-events.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-persistent-usage-record-events.html
new file mode 100644 (file)
index 0000000..eb9c22c
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, persistent-usage-record session with Clear Key, mp4, event sequence</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-persistent-usage-record-events.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-basic'],
+            handler = new MessageHandler( 'org.w3.clearkey', contentitem ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       'keyids',
+                        initData:           getInitData(contentitem,'keyids')
+                      };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-persistent-usage-record.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-persistent-usage-record.html
new file mode 100644 (file)
index 0000000..854ddf9
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, persistent-usage-record session with Clear Key, mp4, event sequence</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-persistent-usage-record.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-basic'],
+            handler = new MessageHandler( 'org.w3.clearkey', contentitem ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       'keyids',
+                        initData:           getInitData(contentitem,'keyids')
+                       };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-destroy-persistent-license.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-destroy-persistent-license.html
new file mode 100644 (file)
index 0000000..9740393
--- /dev/null
@@ -0,0 +1,53 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: persistent-license, playback, retrieve, playback and destroy with Clear Key, mp4</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-retrieve-persistent-license.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-basic'],
+            handler = new MessageHandler( 'org.w3.clearkey', contentitem ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       'keyids',
+                        initData:           getInitData(contentitem,'keyids'),
+                        windowscript:       'resources/clearkey-retrieve-destroy-persistent-license.html',
+                        testcase:           'playback, retrieve, playback and destroy' };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-persistent-license.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-persistent-license.html
new file mode 100644 (file)
index 0000000..cd4dbfc
--- /dev/null
@@ -0,0 +1,53 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: persistent-license playback, retrieve and playback with Clear Key, mp4</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-retrieve-persistent-license.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-basic'],
+            handler = new MessageHandler( 'org.w3.clearkey', contentitem ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       'keyids',
+                        initData:           getInitData(contentitem,'keyids'),
+                        windowscript:       'resources/clearkey-retrieve-persistent-license.html',
+                        testcase:           'playback, retrieve and playback' };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-persistent-usage-record.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-persistent-usage-record.html
new file mode 100644 (file)
index 0000000..aaaa6ac
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: persistent-usage-record, playback and retrieve record in new window, Clear Key, mp4</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-retrieve-persistent-usage-record.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-basic'],
+            handler = new MessageHandler( 'org.w3.clearkey', contentitem ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       'keyids',
+                        initData:           getInitData(contentitem,'keyids'),
+                        windowscript:       'resources/retrieve-persistent-usage-record.html' };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-clear-encrypted.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-clear-encrypted.html
new file mode 100644 (file)
index 0000000..406a6d3
--- /dev/null
@@ -0,0 +1,53 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with Clear Key, mp4, clear then encrypted</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-clear-encrypted'],
+            handler = new MessageHandler('org.w3.clearkey', contentitem),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       'keyids',
+                        initData:           getInitData(contentitem, 'keyids'),
+                        duration:           4,
+                        testcase:           'single key, clear then encrypted content' };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-encrypted-clear-sources.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-encrypted-clear-sources.html
new file mode 100644 (file)
index 0000000..76d393c
--- /dev/null
@@ -0,0 +1,58 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, alternate Encrypted and Clear playbacks, Temporary, mp4, 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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary-encrypted-clear-sources.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var encryptedcontentitem = content['mp4-basic'],
+            clearcontentitem = content['mp4-clear'],
+            handler = new MessageHandler('org.w3.clearkey', encryptedcontentitem),
+            configEncrypted = { video:              document.getElementById('videoelement'),
+                                keysystem:          'org.w3.clearkey',
+                                messagehandler:     handler.messagehandler,
+                                audioPath:          encryptedcontentitem.audio.path,
+                                videoPath:          encryptedcontentitem.video.path,
+                                audioType:          encryptedcontentitem.audio.type,
+                                videoType:          encryptedcontentitem.video.type,
+                                initDataType:       'keyids',
+                                initData:           getInitData(encryptedcontentitem, 'keyids'),
+                            },
+            configClear = { audioPath:          clearcontentitem.audio.path,
+                            videoPath:          clearcontentitem.video.path,
+                            audioType:          clearcontentitem.audio.type,
+                            videoType:          clearcontentitem.video.type,
+                            };
+
+        runTest(configEncrypted,configClear);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-encrypted-clear.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-encrypted-clear.html
new file mode 100644 (file)
index 0000000..1ab5fbc
--- /dev/null
@@ -0,0 +1,53 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with Clear Key, mp4, encrypted then clear</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-encrypted-clear'],
+            handler = new MessageHandler('org.w3.clearkey', contentitem),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       'keyids',
+                        initData:           getInitData(contentitem, 'keyids'),
+                        duration:           4,
+                        testcase:           'single key, encrypted then clear content' };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-events.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-events.html
new file mode 100644 (file)
index 0000000..f780f0c
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful playback, Temporary session with Clear Key, mp4, validating events</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary-events.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-basic'],
+            handler = new MessageHandler( 'org.w3.clearkey', contentitem ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       'keyids',
+                        initData:           getInitData(contentitem,'keyids')
+                      };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-sequential-readyState.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-sequential-readyState.html
new file mode 100644 (file)
index 0000000..47e68e2
--- /dev/null
@@ -0,0 +1,55 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <meta name="timeout" content="long">
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with Clear Key, mp4, multiple keys in sequence, check readyState</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary-multikey-sequential.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-multikey-sequential'],
+            handler = new MessageHandler('org.w3.clearkey', contentitem),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       'keyids',
+                        initData:           getMultikeyInitDatas(contentitem, 'keyids'),
+                        duration:           5,
+                        checkReadyState:    true
+                     };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-sequential.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey-sequential.html
new file mode 100644 (file)
index 0000000..a38b3b9
--- /dev/null
@@ -0,0 +1,54 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <meta name="timeout" content="long">
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with Clear Key, mp4, multiple keys in sequence</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary-multikey-sequential.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-multikey-sequential'],
+            handler = new MessageHandler( 'org.w3.clearkey', contentitem ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       'keyids',
+                        initData:           getMultikeyInitDatas(contentitem,'keyids'),
+                        duration:           5
+                     };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey.html
new file mode 100644 (file)
index 0000000..2a179f3
--- /dev/null
@@ -0,0 +1,53 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with Clear Key, mp4, multiple keys for audio/video</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-av-multikey'],
+            handler = new MessageHandler( 'org.w3.clearkey', contentitem ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       'keyids',
+                        initData:           getInitData(contentitem,'keyids'),
+                        testcase:           'multikey audio/video' };
+
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multisession.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multisession.html
new file mode 100644 (file)
index 0000000..e02b33d
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with Clear Key, mp4, multiple keys in sequence</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary-multisession.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-multikey'],
+            handler = new MessageHandler( 'org.w3.clearkey', contentitem ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       'keyids',
+                        initData:           getMultikeyInitDatas(contentitem,'keyids'),
+                        testcase:           'multikey video' };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-after-src.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-after-src.html
new file mode 100644 (file)
index 0000000..cacd67f
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with Clear Key, mp4</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary-setMediaKeys.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-basic'],
+            handler = new MessageHandler( 'org.w3.clearkey', contentitem ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       'keyids',
+                        initData:           getInitData(contentitem,'keyids'),
+                        testcase:           SETMEDIAKEYS_AFTER_SRC };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-after-update.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-after-update.html
new file mode 100644 (file)
index 0000000..df2e322
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with Clear Key, mp4</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary-setMediaKeys.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-basic'],
+            handler = new MessageHandler( 'org.w3.clearkey', contentitem ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       'keyids',
+                        initData:           getInitData(contentitem,'keyids'),
+                        testcase:           SETMEDIAKEYS_AFTER_UPDATE };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-immediately.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-immediately.html
new file mode 100644 (file)
index 0000000..454dabe
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with Clear Key, mp4</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary-setMediaKeys.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-basic'],
+            handler = new MessageHandler( 'org.w3.clearkey', contentitem ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       'keyids',
+                        initData:           getInitData(contentitem,'keyids'),
+                        testcase:           SETMEDIAKEYS_IMMEDIATELY };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-onencrypted.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-onencrypted.html
new file mode 100644 (file)
index 0000000..2a09cd3
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with Clear Key, mp4</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary-setMediaKeys.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-basic'],
+            handler = new MessageHandler( 'org.w3.clearkey', contentitem ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       'keyids',
+                        initData:           getInitData(contentitem,'keyids'),
+                        testcase:           SETMEDIAKEYS_ONENCRYPTED };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-two-videos.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-two-videos.html
new file mode 100644 (file)
index 0000000..ac125d5
--- /dev/null
@@ -0,0 +1,55 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <meta name="timeout" content="long">
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with Clear Key, mp4, two videos</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary-two-videos.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement1" width="200px"></video>
+      <video id="videoelement2" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-basic'],
+            handler = new MessageHandler( 'org.w3.clearkey', contentitem ),
+            config = {  video:              [   document.getElementById( 'videoelement1' ),
+                                                document.getElementById( 'videoelement2' ) ],
+                        keysystem:          'org.w3.clearkey',
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       'keyids',
+                        initData:           getInitData(contentitem,'keyids'),
+                       };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey.html
new file mode 100644 (file)
index 0000000..72a1fba
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with Clear Key, mp4, play, wait for key, continue play</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary-waitingforkey.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-basic'],
+            handler = new MessageHandler( 'org.w3.clearkey', contentitem ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       'keyids',
+                        initData:           getMultikeyInitDatas(contentitem,'keyids')
+                    };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary.html
new file mode 100644 (file)
index 0000000..4839c54
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with Clear Key, mp4</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-basic'],
+            handler = new MessageHandler( 'org.w3.clearkey', contentitem ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       'keyids',
+                        initData:           getInitData(contentitem,'keyids'),
+                        testcase:           'single key' };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-requestmediakeysystemaccess.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-requestmediakeysystemaccess.html
new file mode 100644 (file)
index 0000000..dd25b84
--- /dev/null
@@ -0,0 +1,40 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <meta name="timeout" content="long">
+    <title>Encrypted Media Extensions: requestMediaKeySystemAccess tests, 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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.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/requestmediakeysystemaccess.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <script>
+        var contentitem = content['mp4-basic'],
+            config = {  keysystem:          'org.w3.clearkey',
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       'keyids'
+                    };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-reset-src-after-setmediakeys.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-reset-src-after-setmediakeys.html
new file mode 100644 (file)
index 0000000..e20ff72
--- /dev/null
@@ -0,0 +1,47 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions - Reset MediaSource after setMediaKeys for Clear Key, mp4</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>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/fetch.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/reset-src-after-setmediakeys.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentItem = content['mp4-av-multikey'],
+            config = {
+                video: document.getElementById('videoelement'),
+                keysystem: 'org.w3.clearkey',
+                content: contentItem,
+                initDataType: 'keyids',
+                initData: getInitData(contentItem,'keyids'),
+                audioType: contentItem.audio.type,
+                videoType: contentItem.video.type,
+                audioPath: contentItem.audio.path,
+                videoPath: contentItem.video.path,
+            };
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-again-after-playback.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-again-after-playback.html
new file mode 100644 (file)
index 0000000..77f8b7a
--- /dev/null
@@ -0,0 +1,53 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: setMediaKeys again after playback 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>
+    <script src=/encrypted-media/util/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/setmediakeys-again-after-playback.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-basic'],
+            handler = new MessageHandler('org.w3.clearkey', contentitem);
+        getSupportedContent('org.w3.clearkey').then( function(contents) {
+            runTest( {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        messagehandler:     handler.messagehandler,
+                        content:            contentitem,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       'keyids',
+                        initData:           getInitData(contentitem, 'keyids')
+                     } );
+        } );
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-again-after-resetting-src.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-again-after-resetting-src.html
new file mode 100644 (file)
index 0000000..3ad282a
--- /dev/null
@@ -0,0 +1,53 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: setMediaKeys again after resetting src attribute on video element 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>
+    <script src=/encrypted-media/util/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/setmediakeys-again-after-resetting-src.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-basic'],
+            handler = new MessageHandler('org.w3.clearkey', contentitem );
+        getSupportedContent( 'org.w3.clearkey' ).then( function( contents ) {
+            runTest( {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        messagehandler:     handler.messagehandler,
+                        content:            contentitem,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       'keyids',
+                        initData:           getInitData(contentitem,'keyids')
+                     } );
+        } );
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-at-same-time.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-at-same-time.html
new file mode 100644 (file)
index 0000000..c572ba5
--- /dev/null
@@ -0,0 +1,43 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: setMediaKeys multiple at same time 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>
+    <script src=/encrypted-media/util/fetch.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/setmediakeys-at-same-time.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        getSupportedContent( 'org.w3.clearkey' ).then( function( contents ) {
+            runTest( {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        content:            contents[ 0 ]
+                     } );
+        } );
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-multiple-times-with-different-mediakeys.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-multiple-times-with-different-mediakeys.html
new file mode 100644 (file)
index 0000000..76209f9
--- /dev/null
@@ -0,0 +1,49 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: setMediaKeys multiple times with different mediakeys 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>
+    <script src=/encrypted-media/util/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/setmediakeys-multiple-times-with-different-mediakeys.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-basic'];
+        getSupportedContent( 'org.w3.clearkey' ).then( function( contents ) {
+            runTest( {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        content:            contentitem,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type
+                     } );
+        } );
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-multiple-times-with-the-same-mediakeys.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-multiple-times-with-the-same-mediakeys.html
new file mode 100644 (file)
index 0000000..fb746f4
--- /dev/null
@@ -0,0 +1,49 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: setMediaKeys multiple times with the same mediakeys 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>
+    <script src=/encrypted-media/util/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/setmediakeys-multiple-times-with-the-same-mediakeys.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-basic'];
+        getSupportedContent( 'org.w3.clearkey' ).then( function( contents ) {
+            runTest( {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        content:            contentitem,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type
+                     } );
+        } );
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-to-multiple-video-elements.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-to-multiple-video-elements.html
new file mode 100644 (file)
index 0000000..4a88acb
--- /dev/null
@@ -0,0 +1,47 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: setMediaKeys to multiple video elements 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>
+    <script src=/encrypted-media/util/fetch.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/setmediakeys-to-multiple-video-elements.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video1'>
+      <video id="videoelement1" width="200px"></video>
+    </div>
+    <div id='video2'>
+      <video id="videoelement2" width="200px"></video>
+    </div>
+
+    <script>
+        getSupportedContent( 'org.w3.clearkey' ).then( function( contents ) {
+            runTest( {  video1:              document.getElementById('videoelement1'),
+                        video2:              document.getElementById('videoelement2'),
+                        keysystem:          'org.w3.clearkey',
+                        content:            contents[ 0 ]
+                     } );
+        } );
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys.html
new file mode 100644 (file)
index 0000000..652caa1
--- /dev/null
@@ -0,0 +1,43 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: setMediaKeys 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>
+    <script src=/encrypted-media/util/fetch.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/setmediakeys.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        getSupportedContent( 'org.w3.clearkey' ).then( function( contents ) {
+            runTest( {  video:              document.getElementById('videoelement'),
+                        keysystem:          'org.w3.clearkey',
+                        content:            contents[ 0 ]
+                     } );
+        } );
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-syntax-mediakeys.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-syntax-mediakeys.html
new file mode 100644 (file)
index 0000000..28658e0
--- /dev/null
@@ -0,0 +1,42 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions - Test MediaKeys attribute, setServerCertificate and setServerCertificate exception syntax for Clear Key, mp4</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>
+    <script src=/encrypted-media/util/fetch.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/syntax-mediakeys.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+    <script>
+        var contentItem = content['mp4-basic'],
+            config = {
+                keysystem: 'org.w3.clearkey',
+                content: contentItem,
+                initDataType: 'keyids',
+                initData: getInitData(contentItem, 'keyids'),
+                audioType: contentItem.audio.type,
+                videoType: contentItem.video.type
+                };
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-syntax-mediakeysession.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-syntax-mediakeysession.html
new file mode 100644 (file)
index 0000000..9242160
--- /dev/null
@@ -0,0 +1,42 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions - Test MediaKeySession attribute and function syntax for Clear Key, mp4</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>
+    <script src=/encrypted-media/util/fetch.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/syntax-mediakeysession.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+    <script>
+        var contentItem = content['mp4-basic'],
+            config = {
+                keysystem: 'org.w3.clearkey',
+                content: contentItem,
+                initDataType: 'keyids',
+                initData: getInitData(contentItem, 'keyids'),
+                audioType: contentItem.audio.type,
+                videoType: contentItem.video.type
+                };
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-syntax-mediakeysystemaccess.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-syntax-mediakeysystemaccess.html
new file mode 100644 (file)
index 0000000..3d7bf05
--- /dev/null
@@ -0,0 +1,42 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions - Test navigator.requestmediakeysystemaccess exception and MediaKeySystemAccess attribute syntax for Clear Key, mp4</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>
+    <script src=/encrypted-media/util/fetch.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/syntax-mediakeysystemaccess.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+    <script>
+        var contentItem = content['mp4-basic'],
+            config = {
+                keysystem: 'org.w3.clearkey',
+                content: contentItem,
+                initDataType: 'keyids',
+                initData: getInitData(contentItem, 'keyids'),
+                audioType: contentItem.audio.type,
+                videoType: contentItem.video.type
+                };
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-unique-origin.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-unique-origin.html
new file mode 100644 (file)
index 0000000..47b6733
--- /dev/null
@@ -0,0 +1,43 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Unique origin with Clear Key, mp4</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>
+    <script src=/encrypted-media/util/fetch.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/unique-origin.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+    <div id='video'>
+        <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentItem = content['mp4-av-multikey'],
+            config = {
+                video: document.getElementById('videoelement'),
+                keysystem: 'org.w3.clearkey',
+                initDataType: contentItem.initDataType,
+                audioType: contentItem.audio.type,
+                videoType: contentItem.video.type,
+                audioPath: contentItem.audio.path,
+                videoPath: contentItem.video.path
+            };
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-update-disallowed-input.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-update-disallowed-input.html
new file mode 100644 (file)
index 0000000..a00d30b
--- /dev/null
@@ -0,0 +1,28 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions - Test handling of invalid responses for update() for Clear Key, mp4</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>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/update-disallowed-input.js></script>
+
+  </head>
+  <body>
+    <div id="log"></div>
+    <script>
+        var config = {
+            keysystem: 'org.w3.clearkey',
+        };
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-waiting-for-a-key.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-waiting-for-a-key.html
new file mode 100644 (file)
index 0000000..19467a6
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions - Waiting for a key for Clear Key, mp4</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>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/fetch.js></script>
+
+    <!--  Message handler for DRM servers  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/waiting-for-a-key.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentItem = content['mp4-basic'],
+            handler = new MessageHandler('org.w3.clearkey', contentItem),
+            config = {
+                video: document.getElementById('videoelement'),
+                keysystem: 'org.w3.clearkey',
+                content: contentItem,
+                messageHandler: handler.messagehandler,
+                initDataType: 'keyids',
+                initData: getInitData(contentItem, 'keyids'),
+                audioType: contentItem.audio.type,
+                videoType: contentItem.video.type,
+                audioPath: contentItem.audio.path,
+                videoPath: contentItem.video.path,
+            };
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-not-callable-after-createsession.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-not-callable-after-createsession.html
new file mode 100644 (file)
index 0000000..9b018de
--- /dev/null
@@ -0,0 +1,35 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Test MediaKeySession not callable immediately after CreateSession().</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>
+    <script src=/encrypted-media/util/fetch.js></script>
+
+    <!--  Message handler for Clear Key  -->
+    <script src=/encrypted-media/util/clearkey-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/not-callable-after-createsession.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <script>
+        var config = {  keysystem:          'org.w3.clearkey'
+                     };
+
+        runTest(config);
+
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-update-non-ascii-input.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/clearkey-update-non-ascii-input.html
new file mode 100644 (file)
index 0000000..c5783a8
--- /dev/null
@@ -0,0 +1,36 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Test Clear Key handling of non-ASCII responses for update()</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/clearkey-update-non-ascii-input.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <script>
+        var contentItem = content['mp4-basic'],
+            config = {
+                keysystem: 'org.w3.clearkey',
+                content: contentItem,
+                initDataType: "keyids"
+            };
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/audio_aac-lc_128k_2keys_2sess.mp4 b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/audio_aac-lc_128k_2keys_2sess.mp4
new file mode 100644 (file)
index 0000000..526998d
Binary files /dev/null and b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/audio_aac-lc_128k_2keys_2sess.mp4 differ
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/audio_aac-lc_128k_dashinit.mp4 b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/audio_aac-lc_128k_dashinit.mp4
new file mode 100644 (file)
index 0000000..4daf4d5
Binary files /dev/null and b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/audio_aac-lc_128k_dashinit.mp4 differ
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/audio_aac-lc_128k_enc_dashinit.mp4 b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/audio_aac-lc_128k_enc_dashinit.mp4
new file mode 100644 (file)
index 0000000..77e869f
Binary files /dev/null and b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/audio_aac-lc_128k_enc_dashinit.mp4 differ
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/content-metadata.js b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/content-metadata.js
new file mode 100644 (file)
index 0000000..8ba5bcf
--- /dev/null
@@ -0,0 +1,297 @@
+content = addMemberListToObject( {
+
+    'mp4-clear' : {     initDataType:   'cenc',
+                        audio : {   type:   'audio/mp4;codecs="mp4a.40.2"',
+                                    path:   '/encrypted-media/content/audio_aac-lc_128k_dashinit.mp4' },
+                        video : {   type:   'video/mp4;codecs="avc1.4d401e"',
+                                    path:   '/encrypted-media/content/video_512x288_h264-360k_clear_dashinit.mp4' }
+                    },
+
+    'mp4-basic' : {     assetId:        'mp4-basic',
+                        initDataType:   'cenc',
+                        audio : {   type:   'audio/mp4;codecs="mp4a.40.2"',
+                                    path:   '/encrypted-media/content/audio_aac-lc_128k_dashinit.mp4' },
+                        video : {   type:   'video/mp4;codecs="avc1.4d401e"',
+                                    path:   '/encrypted-media/content/video_512x288_h264-360k_enc_dashinit.mp4' },
+                        keys :  [ { kid: [ 0xad, 0x13, 0xf9, 0xea, 0x2b, 0xe6, 0x98, 0xb8, 0x75, 0xf5, 0x04, 0xa8, 0xe3, 0xcc, 0xea, 0x64 ],
+                                    key: [ 0xbe, 0x7d, 0xf8, 0xa3, 0x66, 0x7a, 0x6a, 0x8f, 0xd5, 0x64, 0xd0, 0xed, 0x81, 0x33, 0x9a, 0x95 ],
+                                    initDataType: 'cenc',
+                                    initData: 'AAAAcXBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAFEIARIQrRP56ivmmLh19QSo48zqZBoIY2FzdGxhYnMiKGV5SmhjM05sZEVsa0lqb2laVzFsTFhSbGMzUXRjMmx1WjJ4bEluMD0yB2RlZmF1bHQAAAMacHNzaAAAAACaBPB5mEBChquS5lvgiF+VAAAC+voCAAABAAEA8AI8AFcAUgBNAEgARQBBAEQARQBSACAAeABtAGwAbgBzAD0AIgBoAHQAdABwADoALwAvAHMAYwBoAGUAbQBhAHMALgBtAGkAYwByAG8AcwBvAGYAdAAuAGMAbwBtAC8ARABSAE0ALwAyADAAMAA3AC8AMAAzAC8AUABsAGEAeQBSAGUAYQBkAHkASABlAGEAZABlAHIAIgAgAHYAZQByAHMAaQBvAG4APQAiADQALgAwAC4AMAAuADAAIgA+ADwARABBAFQAQQA+ADwAUABSAE8AVABFAEMAVABJAE4ARgBPAD4APABLAEUAWQBMAEUATgA+ADEANgA8AC8ASwBFAFkATABFAE4APgA8AEEATABHAEkARAA+AEEARQBTAEMAVABSADwALwBBAEwARwBJAEQAPgA8AC8AUABSAE8AVABFAEMAVABJAE4ARgBPAD4APABLAEkARAA+ADYAdgBrAFQAcgBlAFkAcgB1AEoAaAAxADkAUQBTAG8ANAA4AHoAcQBaAEEAPQA9ADwALwBLAEkARAA+ADwAQwBIAEUAQwBLAFMAVQBNAD4AagBZAEYATgBmADAAeQBmADQAaQBzAD0APAAvAEMASABFAEMASwBTAFUATQA+ADwATABBAF8AVQBSAEwAPgBoAHQAdABwADoALwAvAHAAbABhAHkAcgBlAGEAZAB5AC4AZABpAHIAZQBjAHQAdABhAHAAcwAuAG4AZQB0AC8AcAByAC8AcwB2AGMALwByAGkAZwBoAHQAcwBtAGEAbgBhAGcAZQByAC4AYQBzAG0AeAA/AFAAbABhAHkAUgBpAGcAaAB0AD0AMQAmAGEAbQBwADsAVQBzAGUAUwBpAG0AcABsAGUATgBvAG4AUABlAHIAcwBpAHMAdABlAG4AdABMAGkAYwBlAG4AcwBlAD0AMQA8AC8ATABBAF8AVQBSAEwAPgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AA==' } ]
+                    },
+
+    'mp4-clear-encrypted' : {
+                        assetId:        'mp4-basic',
+                        initDataType:   'cenc',
+                        audio : {   type:   'audio/mp4;codecs="mp4a.40.2"',
+                                    path:   '/encrypted-media/content/audio_aac-lc_128k_dashinit.mp4' },
+                        video : {   type:   'video/mp4;codecs="avc1.4d401e"',
+                                    path:   '/encrypted-media/content/video_512x288_h264-360k_clear_enc_dashinit.mp4' },
+                        keys :  [ { kid: [ 0xad, 0x13, 0xf9, 0xea, 0x2b, 0xe6, 0x98, 0xb8, 0x75, 0xf5, 0x04, 0xa8, 0xe3, 0xcc, 0xea, 0x64 ],
+                                    key: [ 0xbe, 0x7d, 0xf8, 0xa3, 0x66, 0x7a, 0x6a, 0x8f, 0xd5, 0x64, 0xd0, 0xed, 0x81, 0x33, 0x9a, 0x95 ],
+                                    initDataType: 'cenc',
+                                    initData: 'AAAAcXBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAFEIARIQrRP56ivmmLh19QSo48zqZBoIY2FzdGxhYnMiKGV5SmhjM05sZEVsa0lqb2laVzFsTFhSbGMzUXRjMmx1WjJ4bEluMD0yB2RlZmF1bHQAAAMacHNzaAAAAACaBPB5mEBChquS5lvgiF+VAAAC+voCAAABAAEA8AI8AFcAUgBNAEgARQBBAEQARQBSACAAeABtAGwAbgBzAD0AIgBoAHQAdABwADoALwAvAHMAYwBoAGUAbQBhAHMALgBtAGkAYwByAG8AcwBvAGYAdAAuAGMAbwBtAC8ARABSAE0ALwAyADAAMAA3AC8AMAAzAC8AUABsAGEAeQBSAGUAYQBkAHkASABlAGEAZABlAHIAIgAgAHYAZQByAHMAaQBvAG4APQAiADQALgAwAC4AMAAuADAAIgA+ADwARABBAFQAQQA+ADwAUABSAE8AVABFAEMAVABJAE4ARgBPAD4APABLAEUAWQBMAEUATgA+ADEANgA8AC8ASwBFAFkATABFAE4APgA8AEEATABHAEkARAA+AEEARQBTAEMAVABSADwALwBBAEwARwBJAEQAPgA8AC8AUABSAE8AVABFAEMAVABJAE4ARgBPAD4APABLAEkARAA+ADYAdgBrAFQAcgBlAFkAcgB1AEoAaAAxADkAUQBTAG8ANAA4AHoAcQBaAEEAPQA9ADwALwBLAEkARAA+ADwAQwBIAEUAQwBLAFMAVQBNAD4AagBZAEYATgBmADAAeQBmADQAaQBzAD0APAAvAEMASABFAEMASwBTAFUATQA+ADwATABBAF8AVQBSAEwAPgBoAHQAdABwADoALwAvAHAAbABhAHkAcgBlAGEAZAB5AC4AZABpAHIAZQBjAHQAdABhAHAAcwAuAG4AZQB0AC8AcAByAC8AcwB2AGMALwByAGkAZwBoAHQAcwBtAGEAbgBhAGcAZQByAC4AYQBzAG0AeAA/AFAAbABhAHkAUgBpAGcAaAB0AD0AMQAmAGEAbQBwADsAVQBzAGUAUwBpAG0AcABsAGUATgBvAG4AUABlAHIAcwBpAHMAdABlAG4AdABMAGkAYwBlAG4AcwBlAD0AMQA8AC8ATABBAF8AVQBSAEwAPgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AA==' } ]
+                    },
+
+    'mp4-encrypted-clear' : {
+                        assetId:        'mp4-basic',
+                        initDataType:   'cenc',
+                        audio : {   type:   'audio/mp4;codecs="mp4a.40.2"',
+                                    path:   '/encrypted-media/content/audio_aac-lc_128k_dashinit.mp4' },
+                        video : {   type:   'video/mp4;codecs="avc1.4d401e"',
+                                    path:   '/encrypted-media/content/video_512x288_h264-360k_enc_clear_dashinit.mp4' },
+                        keys :  [ { kid: [ 0xad, 0x13, 0xf9, 0xea, 0x2b, 0xe6, 0x98, 0xb8, 0x75, 0xf5, 0x04, 0xa8, 0xe3, 0xcc, 0xea, 0x64 ],
+                                    key: [ 0xbe, 0x7d, 0xf8, 0xa3, 0x66, 0x7a, 0x6a, 0x8f, 0xd5, 0x64, 0xd0, 0xed, 0x81, 0x33, 0x9a, 0x95 ],
+                                    initDataType: 'cenc',
+                                    initData: 'AAAAcXBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAFEIARIQrRP56ivmmLh19QSo48zqZBoIY2FzdGxhYnMiKGV5SmhjM05sZEVsa0lqb2laVzFsTFhSbGMzUXRjMmx1WjJ4bEluMD0yB2RlZmF1bHQAAAMacHNzaAAAAACaBPB5mEBChquS5lvgiF+VAAAC+voCAAABAAEA8AI8AFcAUgBNAEgARQBBAEQARQBSACAAeABtAGwAbgBzAD0AIgBoAHQAdABwADoALwAvAHMAYwBoAGUAbQBhAHMALgBtAGkAYwByAG8AcwBvAGYAdAAuAGMAbwBtAC8ARABSAE0ALwAyADAAMAA3AC8AMAAzAC8AUABsAGEAeQBSAGUAYQBkAHkASABlAGEAZABlAHIAIgAgAHYAZQByAHMAaQBvAG4APQAiADQALgAwAC4AMAAuADAAIgA+ADwARABBAFQAQQA+ADwAUABSAE8AVABFAEMAVABJAE4ARgBPAD4APABLAEUAWQBMAEUATgA+ADEANgA8AC8ASwBFAFkATABFAE4APgA8AEEATABHAEkARAA+AEEARQBTAEMAVABSADwALwBBAEwARwBJAEQAPgA8AC8AUABSAE8AVABFAEMAVABJAE4ARgBPAD4APABLAEkARAA+ADYAdgBrAFQAcgBlAFkAcgB1AEoAaAAxADkAUQBTAG8ANAA4AHoAcQBaAEEAPQA9ADwALwBLAEkARAA+ADwAQwBIAEUAQwBLAFMAVQBNAD4AagBZAEYATgBmADAAeQBmADQAaQBzAD0APAAvAEMASABFAEMASwBTAFUATQA+ADwATABBAF8AVQBSAEwAPgBoAHQAdABwADoALwAvAHAAbABhAHkAcgBlAGEAZAB5AC4AZABpAHIAZQBjAHQAdABhAHAAcwAuAG4AZQB0AC8AcAByAC8AcwB2AGMALwByAGkAZwBoAHQAcwBtAGEAbgBhAGcAZQByAC4AYQBzAG0AeAA/AFAAbABhAHkAUgBpAGcAaAB0AD0AMQAmAGEAbQBwADsAVQBzAGUAUwBpAG0AcABsAGUATgBvAG4AUABlAHIAcwBpAHMAdABlAG4AdABMAGkAYwBlAG4AcwBlAD0AMQA8AC8ATABBAF8AVQBSAEwAPgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AA==' } ]
+                    },
+
+
+    'mp4-av-multikey' : {
+                        assetId:        'mp4-basic',
+                        initDataType:   'cenc',
+                        associatedInitData: true,       // indicates that initData for one key causes other keys to be returned as well
+                        audio:  {   type:   'audio/mp4;codecs="mp4a.40.2"',
+                                    path:   '/encrypted-media/content/audio_aac-lc_128k_enc_dashinit.mp4' },
+                        video : {   type:   'video/mp4;codecs="avc1.4d401e"',
+                                    path:   '/encrypted-media/content/video_512x288_h264-360k_enc_dashinit.mp4' },
+                        keys :  [ { kid: [ 0xad, 0x13, 0xf9, 0xea, 0x2b, 0xe6, 0x98, 0xb8, 0x75, 0xf5, 0x04, 0xa8, 0xe3, 0xcc, 0xea, 0x64 ],
+                                    key: [ 0xbe, 0x7d, 0xf8, 0xa3, 0x66, 0x7a, 0x6a, 0x8f, 0xd5, 0x64, 0xd0, 0xed, 0x81, 0x33, 0x9a, 0x95 ],
+                                    initDataType: 'cenc',
+                                    initData: 'AAAAcXBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAFEIARIQrRP56ivmmLh19QSo48zqZBoIY2FzdGxhYnMiKGV5SmhjM05sZEVsa0lqb2laVzFsTFhSbGMzUXRjMmx1WjJ4bEluMD0yB2RlZmF1bHQAAAMacHNzaAAAAACaBPB5mEBChquS5lvgiF+VAAAC+voCAAABAAEA8AI8AFcAUgBNAEgARQBBAEQARQBSACAAeABtAGwAbgBzAD0AIgBoAHQAdABwADoALwAvAHMAYwBoAGUAbQBhAHMALgBtAGkAYwByAG8AcwBvAGYAdAAuAGMAbwBtAC8ARABSAE0ALwAyADAAMAA3AC8AMAAzAC8AUABsAGEAeQBSAGUAYQBkAHkASABlAGEAZABlAHIAIgAgAHYAZQByAHMAaQBvAG4APQAiADQALgAwAC4AMAAuADAAIgA+ADwARABBAFQAQQA+ADwAUABSAE8AVABFAEMAVABJAE4ARgBPAD4APABLAEUAWQBMAEUATgA+ADEANgA8AC8ASwBFAFkATABFAE4APgA8AEEATABHAEkARAA+AEEARQBTAEMAVABSADwALwBBAEwARwBJAEQAPgA8AC8AUABSAE8AVABFAEMAVABJAE4ARgBPAD4APABLAEkARAA+ADYAdgBrAFQAcgBlAFkAcgB1AEoAaAAxADkAUQBTAG8ANAA4AHoAcQBaAEEAPQA9ADwALwBLAEkARAA+ADwAQwBIAEUAQwBLAFMAVQBNAD4AagBZAEYATgBmADAAeQBmADQAaQBzAD0APAAvAEMASABFAEMASwBTAFUATQA+ADwATABBAF8AVQBSAEwAPgBoAHQAdABwADoALwAvAHAAbABhAHkAcgBlAGEAZAB5AC4AZABpAHIAZQBjAHQAdABhAHAAcwAuAG4AZQB0AC8AcAByAC8AcwB2AGMALwByAGkAZwBoAHQAcwBtAGEAbgBhAGcAZQByAC4AYQBzAG0AeAA/AFAAbABhAHkAUgBpAGcAaAB0AD0AMQAmAGEAbQBwADsAVQBzAGUAUwBpAG0AcABsAGUATgBvAG4AUABlAHIAcwBpAHMAdABlAG4AdABMAGkAYwBlAG4AcwBlAD0AMQA8AC8ATABBAF8AVQBSAEwAPgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AA==' },
+                                  { kid: [ 0x55, 0x8e, 0xe5, 0x41, 0xb9, 0x0a, 0xb2, 0xf3, 0x95, 0x0d, 0x00, 0xad, 0xe3, 0x76, 0x0d, 0x45 ],
+                                    key: [ 0x91, 0x03, 0x92, 0x63, 0x01, 0x6d, 0xa6, 0x35, 0x77, 0x0d, 0x57, 0xdb, 0x92, 0xf9, 0x8b, 0xd0 ],
+                                    initDataType : 'cenc',
+                                    initData: 'AAAAcXBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAFEIARIQVY7lQbkKsvOVDQCt43YNRRoIY2FzdGxhYnMiKGV5SmhjM05sZEVsa0lqb2laVzFsTFhSbGMzUXRjMmx1WjJ4bEluMD0yB2RlZmF1bHQAAAMacHNzaAAAAACaBPB5mEBChquS5lvgiF+VAAAC+voCAAABAAEA8AI8AFcAUgBNAEgARQBBAEQARQBSACAAeABtAGwAbgBzAD0AIgBoAHQAdABwADoALwAvAHMAYwBoAGUAbQBhAHMALgBtAGkAYwByAG8AcwBvAGYAdAAuAGMAbwBtAC8ARABSAE0ALwAyADAAMAA3AC8AMAAzAC8AUABsAGEAeQBSAGUAYQBkAHkASABlAGEAZABlAHIAIgAgAHYAZQByAHMAaQBvAG4APQAiADQALgAwAC4AMAAuADAAIgA+ADwARABBAFQAQQA+ADwAUABSAE8AVABFAEMAVABJAE4ARgBPAD4APABLAEUAWQBMAEUATgA+ADEANgA8AC8ASwBFAFkATABFAE4APgA8AEEATABHAEkARAA+AEEARQBTAEMAVABSADwALwBBAEwARwBJAEQAPgA8AC8AUABSAE8AVABFAEMAVABJAE4ARgBPAD4APABLAEkARAA+AFEAZQBXAE8AVgBRAHEANQA4ADcASwBWAEQAUQBDAHQANAAzAFkATgBSAFEAPQA9ADwALwBLAEkARAA+ADwAQwBIAEUAQwBLAFMAVQBNAD4AWQBpAE8ALwAxADYATABzADkANgBFAD0APAAvAEMASABFAEMASwBTAFUATQA+ADwATABBAF8AVQBSAEwAPgBoAHQAdABwADoALwAvAHAAbABhAHkAcgBlAGEAZAB5AC4AZABpAHIAZQBjAHQAdABhAHAAcwAuAG4AZQB0AC8AcAByAC8AcwB2AGMALwByAGkAZwBoAHQAcwBtAGEAbgBhAGcAZQByAC4AYQBzAG0AeAA/AFAAbABhAHkAUgBpAGcAaAB0AD0AMQAmAGEAbQBwADsAVQBzAGUAUwBpAG0AcABsAGUATgBvAG4AUABlAHIAcwBpAHMAdABlAG4AdABMAGkAYwBlAG4AcwBlAD0AMQA8AC8ATABBAF8AVQBSAEwAPgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AA==' } ]
+                    },
+
+    'mp4-multikey' :  {     assetId:        'mp4-multikey',
+                            initDataType:   'cenc',
+                            audio:  {   type:   'audio/mp4;codecs="mp4a.40.2"',
+                                        path:   '/encrypted-media/content/audio_aac-lc_128k_2keys_2sess.mp4' },
+                            video:  {   type:   'video/mp4;codecs="avc1.4d401e"',
+                                        path:   '/encrypted-media/content/video_512x288_h264-360k_enc_2keys_2sess.mp4' },
+                            keys: [ {   kid:    [ 0x13, 0xa7, 0x53, 0x06, 0xd1, 0x18, 0x91, 0x7b, 0x47, 0xa6, 0xc1, 0x83, 0x64, 0x42, 0x51, 0x6f ],
+                                        key:    [ 0x8a, 0xaa, 0xd8, 0xc4, 0xdb, 0xde, 0xac, 0xcd, 0xad, 0x26, 0x76, 0xa1, 0xed, 0x38, 0x95, 0x2e ],
+                                        variantId:      'key1',
+                                        initDataType:   'cenc',
+                                        initData: 'AAAAjXBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAG0IARIQE6dTBtEYkXtHpsGDZEJRbxoIY2FzdGxhYnMiRGV5SmhjM05sZEVsa0lqb2laVzFsTFhSbGMzUXRNbk5sYzNOcGIyNGlMQ0oyWVhKcFlXNTBTV1FpT2lKclpYa3hJbjA9MgdkZWZhdWx0AAADwnBzc2gAAAAAmgTweZhAQoarkuZb4IhflQAAA6KiAwAAAQABAJgDPABXAFIATQBIAEUAQQBEAEUAUgAgAHgAbQBsAG4AcwA9ACIAaAB0AHQAcAA6AC8ALwBzAGMAaABlAG0AYQBzAC4AbQBpAGMAcgBvAHMAbwBmAHQALgBjAG8AbQAvAEQAUgBNAC8AMgAwADAANwAvADAAMwAvAFAAbABhAHkAUgBlAGEAZAB5AEgAZQBhAGQAZQByACIAIAB2AGUAcgBzAGkAbwBuAD0AIgA0AC4AMAAuADAALgAwACIAPgA8AEQAQQBUAEEAPgA8AFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBFAFkATABFAE4APgAxADYAPAAvAEsARQBZAEwARQBOAD4APABBAEwARwBJAEQAPgBBAEUAUwBDAFQAUgA8AC8AQQBMAEcASQBEAD4APAAvAFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBJAEQAPgBCAGwATwBuAEUAeABqAFIAZQA1AEYASABwAHMARwBEAFoARQBKAFIAYgB3AD0APQA8AC8ASwBJAEQAPgA8AEwAQQBfAFUAUgBMAD4AaAB0AHQAcABzADoALwAvAGwAaQBjAC4AcwB0AGEAZwBpAG4AZwAuAGQAcgBtAHQAbwBkAGEAeQAuAGMAbwBtAC8AbABpAGMAZQBuAHMAZQAtAHAAcgBvAHgAeQAtAGgAZQBhAGQAZQByAGEAdQB0AGgALwBkAHIAbQB0AG8AZABhAHkALwBSAGkAZwBoAHQAcwBNAGEAbgBhAGcAZQByAC4AYQBzAG0AeAA8AC8ATABBAF8AVQBSAEwAPgA8AEwAVQBJAF8AVQBSAEwAPgBoAHQAdABwAHMAOgAvAC8AbABpAGMALgBzAHQAYQBnAGkAbgBnAC4AZAByAG0AdABvAGQAYQB5AC4AYwBvAG0ALwBsAGkAYwBlAG4AcwBlAC0AcAByAG8AeAB5AC0AaABlAGEAZABlAHIAYQB1AHQAaAAvAGQAcgBtAHQAbwBkAGEAeQAvAFIAaQBnAGgAdABzAE0AYQBuAGEAZwBlAHIALgBhAHMAbQB4ADwALwBMAFUASQBfAFUAUgBMAD4APABDAEgARQBDAEsAUwBVAE0APgBJAEQAUgB0AFAAZwBVAEkALwBiAEkAPQA8AC8AQwBIAEUAQwBLAFMAVQBNAD4APAAvAEQAQQBUAEEAPgA8AC8AVwBSAE0ASABFAEEARABFAFIAPgA=' },
+                                    {   kid:    [ 0xee, 0x73, 0x56, 0x4e, 0xc8, 0xa8, 0x90, 0xf0, 0x78, 0xef, 0x68, 0x71, 0xfa, 0x4b, 0xe1, 0x8b ],
+                                        key:    [ 0xe4, 0x4f, 0xe1, 0x45, 0x7c, 0x5e, 0xbc, 0xd8, 0x3e, 0xad, 0xdc, 0xd6, 0x2c, 0xaf, 0x55, 0x18 ],
+                                        variantId:      'key2',
+                                        initDataType:   'cenc',
+                                        initData: 'AAAAjXBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAG0IARIQ7nNWTsiokPB472hx+kvhixoIY2FzdGxhYnMiRGV5SmhjM05sZEVsa0lqb2laVzFsTFhSbGMzUXRNbk5sYzNOcGIyNGlMQ0oyWVhKcFlXNTBTV1FpT2lKclpYa3lJbjA9MgdkZWZhdWx0AAADwnBzc2gAAAAAmgTweZhAQoarkuZb4IhflQAAA6KiAwAAAQABAJgDPABXAFIATQBIAEUAQQBEAEUAUgAgAHgAbQBsAG4AcwA9ACIAaAB0AHQAcAA6AC8ALwBzAGMAaABlAG0AYQBzAC4AbQBpAGMAcgBvAHMAbwBmAHQALgBjAG8AbQAvAEQAUgBNAC8AMgAwADAANwAvADAAMwAvAFAAbABhAHkAUgBlAGEAZAB5AEgAZQBhAGQAZQByACIAIAB2AGUAcgBzAGkAbwBuAD0AIgA0AC4AMAAuADAALgAwACIAPgA8AEQAQQBUAEEAPgA8AFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBFAFkATABFAE4APgAxADYAPAAvAEsARQBZAEwARQBOAD4APABBAEwARwBJAEQAPgBBAEUAUwBDAFQAUgA8AC8AQQBMAEcASQBEAD4APAAvAFAAUgBPAFQARQBDAFQASQBOAEYATwA+ADwASwBJAEQAPgBUAGwAWgB6ADcAcQBqAEkAOABKAEIANAA3ADIAaAB4ACsAawB2AGgAaQB3AD0APQA8AC8ASwBJAEQAPgA8AEwAQQBfAFUAUgBMAD4AaAB0AHQAcABzADoALwAvAGwAaQBjAC4AcwB0AGEAZwBpAG4AZwAuAGQAcgBtAHQAbwBkAGEAeQAuAGMAbwBtAC8AbABpAGMAZQBuAHMAZQAtAHAAcgBvAHgAeQAtAGgAZQBhAGQAZQByAGEAdQB0AGgALwBkAHIAbQB0AG8AZABhAHkALwBSAGkAZwBoAHQAcwBNAGEAbgBhAGcAZQByAC4AYQBzAG0AeAA8AC8ATABBAF8AVQBSAEwAPgA8AEwAVQBJAF8AVQBSAEwAPgBoAHQAdABwAHMAOgAvAC8AbABpAGMALgBzAHQAYQBnAGkAbgBnAC4AZAByAG0AdABvAGQAYQB5AC4AYwBvAG0ALwBsAGkAYwBlAG4AcwBlAC0AcAByAG8AeAB5AC0AaABlAGEAZABlAHIAYQB1AHQAaAAvAGQAcgBtAHQAbwBkAGEAeQAvAFIAaQBnAGgAdABzAE0AYQBuAGEAZwBlAHIALgBhAHMAbQB4ADwALwBMAFUASQBfAFUAUgBMAD4APABDAEgARQBDAEsAUwBVAE0APgB4AEQASwBBAFkAMAB2AFoAaABVAFUAPQA8AC8AQwBIAEUAQwBLAFMAVQBNAD4APAAvAEQAQQBUAEEAPgA8AC8AVwBSAE0ASABFAEEARABFAFIAPgA=' } ] },
+
+    'mp4-basic-key1' :          {   assetId:    'mp4-multikey-sequential',
+                                    variantId:  'key1',
+                                    initDataType:   'cenc',
+                                    audio: {    type:   'audio/mp4;codecs="mp4a.40.2"',
+                                                path:   '/encrypted-media/content/audio_aac-lc_128k_dashinit.mp4' },
+                                    video: {    type:   'video/mp4;codecs="avc1.4d401e"',
+                                                path:   '/encrypted-media/content/video_512x288_h264-360k_multikey_key1_dashinit.mp4' },
+                                    keys: [ {   kid:    [0x8a, 0x0d, 0x85, 0x45, 0x21, 0x05, 0xd4, 0x15, 0x35, 0x8f, 0xea, 0x8f, 0x68, 0xe6, 0xc1, 0x91],
+                                                key:    [0x76, 0x6f, 0xab, 0xc1, 0x68, 0x3f, 0xf8, 0xef, 0x4e, 0x76, 0x00, 0x24, 0xc5, 0x23, 0x8f, 0x10],
+                                                initDataType:   'cenc',
+                                                initData: 'AAAAlXBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAHUIARIQig2FRSEF1BU1j+qPaObBkRoIY2FzdGxhYnMiTGV5SmhjM05sZEVsa0lqb2liWEEwTFcxMWJIUnBhMlY1TFhObGNYVmxiblJwWVd3aUxDSjJZWEpwWVc1MFNXUWlPaUpyWlhreEluMD0yB2RlZmF1bHQAAANYcHNzaAAAAACaBPB5mEBChquS5lvgiF+VAAADODgDAAABAAEALgM8AFcAUgBNAEgARQBBAEQARQBSACAAeABtAGwAbgBzAD0AIgBoAHQAdABwADoALwAvAHMAYwBoAGUAbQBhAHMALgBtAGkAYwByAG8AcwBvAGYAdAAuAGMAbwBtAC8ARABSAE0ALwAyADAAMAA3AC8AMAAzAC8AUABsAGEAeQBSAGUAYQBkAHkASABlAGEAZABlAHIAIgAgAHYAZQByAHMAaQBvAG4APQAiADQALgAwAC4AMAAuADAAIgA+ADwARABBAFQAQQA+ADwAUABSAE8AVABFAEMAVABJAE4ARgBPAD4APABLAEUAWQBMAEUATgA+ADEANgA8AC8ASwBFAFkATABFAE4APgA8AEEATABHAEkARAA+AEEARQBTAEMAVABSADwALwBBAEwARwBJAEQAPgA8AC8AUABSAE8AVABFAEMAVABJAE4ARgBPAD4APABLAEkARAA+AFIAWQBVAE4AaQBnAFUAaABGAGQAUQAxAGoAKwBxAFAAYQBPAGIAQgBrAFEAPQA9ADwALwBLAEkARAA+ADwATABBAF8AVQBSAEwAPgBoAHQAdABwAHMAOgAvAC8AbABpAGMALgBzAHQAYQBnAGkAbgBnAC4AZAByAG0AdABvAGQAYQB5AC4AYwBvAG0ALwBsAGkAYwBlAG4AcwBlAC0AcAByAG8AeAB5AC0AaABlAGEAZABlAHIAYQB1AHQAaAAvAGQAcgBtAHQAbwBkAGEAeQAvAFIAaQBnAGgAdABzAE0AYQBuAGEAZwBlAHIALgBhAHMAbQB4ADwALwBMAEEAXwBVAFIATAA+ADwATABVAEkAXwBVAFIATAA+AGgAdAB0AHAAcwA6AC8ALwBwAGwAYQB5AHIAZQBhAGQAeQAtAHUAaQAuAGUAeABhAG0AcABsAGUALgBjAG8AbQA8AC8ATABVAEkAXwBVAFIATAA+ADwAQwBIAEUAQwBLAFMAVQBNAD4AcQBOAEkAZQBiAFQAWABzAG8AcgBnAD0APAAvAEMASABFAEMASwBTAFUATQA+ADwALwBEAEEAVABBAD4APAAvAFcAUgBNAEgARQBBAEQARQBSAD4A' } ]
+                                },
+    'mp4-basic-key2' :          {   assetId:    'mp4-multikey-sequential',
+                                    variantId:  'key2',
+                                    initDataType:   'cenc',
+                                    audio: {    type:   'audio/mp4;codecs="mp4a.40.2"',
+                                                path:   '/encrypted-media/content/audio_aac-lc_128k_dashinit.mp4' },
+                                    video: {    type:   'video/mp4;codecs="avc1.4d401e"',
+                                                path:   '/encrypted-media/content/video_512x288_h264-360k_multikey_key2_dashinit.mp4' },
+                                    keys: [ {   kid:    [0xfb, 0xb4, 0xb7, 0xf3, 0x4a, 0xbd, 0x31, 0x87, 0x34, 0x4b, 0xce, 0xc4, 0x5f, 0x96, 0x68, 0x88],
+                                                key:    [0x26, 0x52, 0xc3, 0x1d, 0xf7, 0x92, 0xd1, 0x7b, 0x08, 0xa6, 0xfa, 0xd3, 0x7c, 0xb6, 0x25, 0x60],
+                                                initDataType:   'cenc',
+                                                initData: 'AAAAlXBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAHUIARIQ+7S380q9MYc0S87EX5ZoiBoIY2FzdGxhYnMiTGV5SmhjM05sZEVsa0lqb2liWEEwTFcxMWJIUnBhMlY1TFhObGNYVmxiblJwWVd3aUxDSjJZWEpwWVc1MFNXUWlPaUpyWlhreUluMD0yB2RlZmF1bHQAAANYcHNzaAAAAACaBPB5mEBChquS5lvgiF+VAAADODgDAAABAAEALgM8AFcAUgBNAEgARQBBAEQARQBSACAAeABtAGwAbgBzAD0AIgBoAHQAdABwADoALwAvAHMAYwBoAGUAbQBhAHMALgBtAGkAYwByAG8AcwBvAGYAdAAuAGMAbwBtAC8ARABSAE0ALwAyADAAMAA3AC8AMAAzAC8AUABsAGEAeQBSAGUAYQBkAHkASABlAGEAZABlAHIAIgAgAHYAZQByAHMAaQBvAG4APQAiADQALgAwAC4AMAAuADAAIgA+ADwARABBAFQAQQA+ADwAUABSAE8AVABFAEMAVABJAE4ARgBPAD4APABLAEUAWQBMAEUATgA+ADEANgA8AC8ASwBFAFkATABFAE4APgA8AEEATABHAEkARAA+AEEARQBTAEMAVABSADwALwBBAEwARwBJAEQAPgA8AC8AUABSAE8AVABFAEMAVABJAE4ARgBPAD4APABLAEkARAA+ADgANwBlADAAKwA3ADEASwBoAHoARQAwAFMAOAA3AEUAWAA1AFoAbwBpAEEAPQA9ADwALwBLAEkARAA+ADwATABBAF8AVQBSAEwAPgBoAHQAdABwAHMAOgAvAC8AbABpAGMALgBzAHQAYQBnAGkAbgBnAC4AZAByAG0AdABvAGQAYQB5AC4AYwBvAG0ALwBsAGkAYwBlAG4AcwBlAC0AcAByAG8AeAB5AC0AaABlAGEAZABlAHIAYQB1AHQAaAAvAGQAcgBtAHQAbwBkAGEAeQAvAFIAaQBnAGgAdABzAE0AYQBuAGEAZwBlAHIALgBhAHMAbQB4ADwALwBMAEEAXwBVAFIATAA+ADwATABVAEkAXwBVAFIATAA+AGgAdAB0AHAAcwA6AC8ALwBwAGwAYQB5AHIAZQBhAGQAeQAtAHUAaQAuAGUAeABhAG0AcABsAGUALgBjAG8AbQA8AC8ATABVAEkAXwBVAFIATAA+ADwAQwBIAEUAQwBLAFMAVQBNAD4ARgB0AGkASQBoADYAUwBKAG0AcABZAD0APAAvAEMASABFAEMASwBTAFUATQA+ADwALwBEAEEAVABBAD4APAAvAFcAUgBNAEgARQBBAEQARQBSAD4A' } ] },
+
+    'mp4-multikey-sequential' : {   assetId:    'mp4-multikey-sequential',
+                                    initDataType:   'cenc',
+                                    audio: {    type:   'audio/mp4;codecs="mp4a.40.2"',
+                                                path:   '/encrypted-media/content/audio_aac-lc_128k_dashinit.mp4' },
+                                    video: {    type:   'video/mp4;codecs="avc1.4d401e"',
+                                                path:   '/encrypted-media/content/video_512x288_h264-360k_multikey_dashinit.mp4' },
+                                    keys: [ {   kid:    [0x8a, 0x0d, 0x85, 0x45, 0x21, 0x05, 0xd4, 0x15, 0x35, 0x8f, 0xea, 0x8f, 0x68, 0xe6, 0xc1, 0x91],
+                                                key:    [0x76, 0x6f, 0xab, 0xc1, 0x68, 0x3f, 0xf8, 0xef, 0x4e, 0x76, 0x00, 0x24, 0xc5, 0x23, 0x8f, 0x10],
+                                                variantId:      'key1',
+                                                initDataType:   'cenc',
+                                                initData: 'AAAAlXBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAHUIARIQig2FRSEF1BU1j+qPaObBkRoIY2FzdGxhYnMiTGV5SmhjM05sZEVsa0lqb2liWEEwTFcxMWJIUnBhMlY1TFhObGNYVmxiblJwWVd3aUxDSjJZWEpwWVc1MFNXUWlPaUpyWlhreEluMD0yB2RlZmF1bHQAAANYcHNzaAAAAACaBPB5mEBChquS5lvgiF+VAAADODgDAAABAAEALgM8AFcAUgBNAEgARQBBAEQARQBSACAAeABtAGwAbgBzAD0AIgBoAHQAdABwADoALwAvAHMAYwBoAGUAbQBhAHMALgBtAGkAYwByAG8AcwBvAGYAdAAuAGMAbwBtAC8ARABSAE0ALwAyADAAMAA3AC8AMAAzAC8AUABsAGEAeQBSAGUAYQBkAHkASABlAGEAZABlAHIAIgAgAHYAZQByAHMAaQBvAG4APQAiADQALgAwAC4AMAAuADAAIgA+ADwARABBAFQAQQA+ADwAUABSAE8AVABFAEMAVABJAE4ARgBPAD4APABLAEUAWQBMAEUATgA+ADEANgA8AC8ASwBFAFkATABFAE4APgA8AEEATABHAEkARAA+AEEARQBTAEMAVABSADwALwBBAEwARwBJAEQAPgA8AC8AUABSAE8AVABFAEMAVABJAE4ARgBPAD4APABLAEkARAA+AFIAWQBVAE4AaQBnAFUAaABGAGQAUQAxAGoAKwBxAFAAYQBPAGIAQgBrAFEAPQA9ADwALwBLAEkARAA+ADwATABBAF8AVQBSAEwAPgBoAHQAdABwAHMAOgAvAC8AbABpAGMALgBzAHQAYQBnAGkAbgBnAC4AZAByAG0AdABvAGQAYQB5AC4AYwBvAG0ALwBsAGkAYwBlAG4AcwBlAC0AcAByAG8AeAB5AC0AaABlAGEAZABlAHIAYQB1AHQAaAAvAGQAcgBtAHQAbwBkAGEAeQAvAFIAaQBnAGgAdABzAE0AYQBuAGEAZwBlAHIALgBhAHMAbQB4ADwALwBMAEEAXwBVAFIATAA+ADwATABVAEkAXwBVAFIATAA+AGgAdAB0AHAAcwA6AC8ALwBwAGwAYQB5AHIAZQBhAGQAeQAtAHUAaQAuAGUAeABhAG0AcABsAGUALgBjAG8AbQA8AC8ATABVAEkAXwBVAFIATAA+ADwAQwBIAEUAQwBLAFMAVQBNAD4AcQBOAEkAZQBiAFQAWABzAG8AcgBnAD0APAAvAEMASABFAEMASwBTAFUATQA+ADwALwBEAEEAVABBAD4APAAvAFcAUgBNAEgARQBBAEQARQBSAD4A' },
+                                            {   kid:    [0xfb, 0xb4, 0xb7, 0xf3, 0x4a, 0xbd, 0x31, 0x87, 0x34, 0x4b, 0xce, 0xc4, 0x5f, 0x96, 0x68, 0x88],
+                                                key:    [0x26, 0x52, 0xc3, 0x1d, 0xf7, 0x92, 0xd1, 0x7b, 0x08, 0xa6, 0xfa, 0xd3, 0x7c, 0xb6, 0x25, 0x60],
+                                                variantId:      'key2',
+                                                initDataType:   'cenc',
+                                                initData: 'AAAAlXBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAHUIARIQ+7S380q9MYc0S87EX5ZoiBoIY2FzdGxhYnMiTGV5SmhjM05sZEVsa0lqb2liWEEwTFcxMWJIUnBhMlY1TFhObGNYVmxiblJwWVd3aUxDSjJZWEpwWVc1MFNXUWlPaUpyWlhreUluMD0yB2RlZmF1bHQAAANYcHNzaAAAAACaBPB5mEBChquS5lvgiF+VAAADODgDAAABAAEALgM8AFcAUgBNAEgARQBBAEQARQBSACAAeABtAGwAbgBzAD0AIgBoAHQAdABwADoALwAvAHMAYwBoAGUAbQBhAHMALgBtAGkAYwByAG8AcwBvAGYAdAAuAGMAbwBtAC8ARABSAE0ALwAyADAAMAA3AC8AMAAzAC8AUABsAGEAeQBSAGUAYQBkAHkASABlAGEAZABlAHIAIgAgAHYAZQByAHMAaQBvAG4APQAiADQALgAwAC4AMAAuADAAIgA+ADwARABBAFQAQQA+ADwAUABSAE8AVABFAEMAVABJAE4ARgBPAD4APABLAEUAWQBMAEUATgA+ADEANgA8AC8ASwBFAFkATABFAE4APgA8AEEATABHAEkARAA+AEEARQBTAEMAVABSADwALwBBAEwARwBJAEQAPgA8AC8AUABSAE8AVABFAEMAVABJAE4ARgBPAD4APABLAEkARAA+ADgANwBlADAAKwA3ADEASwBoAHoARQAwAFMAOAA3AEUAWAA1AFoAbwBpAEEAPQA9ADwALwBLAEkARAA+ADwATABBAF8AVQBSAEwAPgBoAHQAdABwAHMAOgAvAC8AbABpAGMALgBzAHQAYQBnAGkAbgBnAC4AZAByAG0AdABvAGQAYQB5AC4AYwBvAG0ALwBsAGkAYwBlAG4AcwBlAC0AcAByAG8AeAB5AC0AaABlAGEAZABlAHIAYQB1AHQAaAAvAGQAcgBtAHQAbwBkAGEAeQAvAFIAaQBnAGgAdABzAE0AYQBuAGEAZwBlAHIALgBhAHMAbQB4ADwALwBMAEEAXwBVAFIATAA+ADwATABVAEkAXwBVAFIATAA+AGgAdAB0AHAAcwA6AC8ALwBwAGwAYQB5AHIAZQBhAGQAeQAtAHUAaQAuAGUAeABhAG0AcABsAGUALgBjAG8AbQA8AC8ATABVAEkAXwBVAFIATAA+ADwAQwBIAEUAQwBLAFMAVQBNAD4ARgB0AGkASQBoADYAUwBKAG0AcABZAD0APAAvAEMASABFAEMASwBTAFUATQA+ADwALwBEAEEAVABBAD4APAAvAFcAUgBNAEgARQBBAEQARQBSAD4A' } ] },
+
+    'webm' :        {   audio : {   type:   'audio/webm; codecs="opus"' },
+                        video : {   type:   'video/webm; codecs="vp8"',
+                                    path:   '/encrypted-media/content/test-encrypted.webm' },
+                        keys :  [ { kid:    [48,49,50,51,52,53,54,55,56,57,48,49,50,51,52,53],
+                                    key:    [0xeb, 0xdd, 0x62, 0xf1, 0x68, 0x14, 0xd2, 0x7b,
+                                             0x68, 0xef, 0x12, 0x2a, 0xfc, 0xe4, 0xae, 0x3c ] } ]
+                    },
+    'webm-multikey' :
+                    {   audio : {   type:   'audio/webm; codecs="opus"' },
+                        video : {   type:   'video/webm; codecs="vp8"',
+                                    path:   '/encrypted-media/content/test-encrypted-different-av-keys.webm' },
+                        keys :  [ { kid:    [48,49,50,51,52,53,54,55,56,57,48,49,50,51,52,53],
+                                    key:    [   0x7A, 0x7A, 0x62, 0xF1, 0x68, 0x14, 0xD2, 0x7B,
+                                                0x68, 0xEF, 0x12, 0x2A, 0xFC, 0xE4, 0xAE, 0x0A ] },
+                                  { kid:    [49,50,51,52,53,54,55,56,57,48,49,50,51,52,53,54],
+                                    key:    [   0x30, 0x30, 0x62, 0xF1, 0x68, 0x14, 0xD2, 0x7B,
+                                                0x68, 0xEF, 0x12, 0x2A, 0xFC, 0xE4, 0xAE, 0x0A ] } ]
+                    },
+} );
+
+function addMemberListToObject( o )
+{
+    var items = [ ];
+    for( var item in o )
+    {
+        if ( !o.hasOwnProperty( item ) ) continue;
+
+        o[item].name = item;
+        items.push( o[item] );
+    }
+
+    o._items = items;
+
+    return o;
+}
+
+function getInitData( contentitem, initDataType )
+{
+    if (initDataType == 'webm') {
+      return new Uint8Array( contentitem.keys[ 0 ].kid );       // WebM initData supports only a single key
+    }
+
+    if (initDataType == 'cenc') {
+
+        var size = 36 + contentitem.keys.length * 16,
+            kids = contentitem.keys.map( function( k ) { return k.kid; } );
+
+        return new Uint8Array(Array.prototype.concat.call( [
+            0x00, 0x00, size / 256, size % 256, // size
+            0x70, 0x73, 0x73, 0x68, // 'pssh'
+            0x01, // version = 1
+            0x00, 0x00, 0x00, // flags
+            0x10, 0x77, 0xEF, 0xEC, 0xC0, 0xB2, 0x4D, 0x02, // Common SystemID
+            0xAC, 0xE3, 0x3C, 0x1E, 0x52, 0xE2, 0xFB, 0x4B,
+            0x00, 0x00, 0x00, kids.length ], // key count ]
+            Array.prototype.concat.apply( [], kids ),
+          [ 0x00, 0x00, 0x00, 0x00 ]// datasize
+        ));
+    }
+    if (initDataType == 'keyids') {
+
+        return toUtf8( { kids: contentitem.keys.map( function( k ) { return base64urlEncode( new Uint8Array( k.kid ) ); } ) } );
+    }
+    throw 'initDataType ' + initDataType + ' not supported.';
+}
+
+function getSingleKeyInitData( kid, initDataType )
+{
+    if (initDataType == 'webm') {
+      return new Uint8Array( kid );
+    }
+
+    if (initDataType == 'cenc') {
+
+        var size = 52;
+
+        return new Uint8Array(Array.prototype.concat.call( [
+            0x00, 0x00, size / 256, size % 256, // size
+            0x70, 0x73, 0x73, 0x68, // 'pssh'
+            0x01, // version = 1
+            0x00, 0x00, 0x00, // flags
+            0x10, 0x77, 0xEF, 0xEC, 0xC0, 0xB2, 0x4D, 0x02, // Common SystemID
+            0xAC, 0xE3, 0x3C, 0x1E, 0x52, 0xE2, 0xFB, 0x4B,
+            0x00, 0x00, 0x00, 0x01 ], // key count ]
+            kid,
+          [ 0x00, 0x00, 0x00, 0x00 ]// datasize
+        ));
+    }
+    if (initDataType == 'keyids') {
+
+        return toUtf8( { kids: [ base64urlEncode( new Uint8Array( kid ) ) ] } );
+    }
+    throw 'initDataType ' + initDataType + ' not supported.';
+}
+
+function getMultikeyInitDatas( contentitem, initDataType )
+{
+    return contentitem.keys.map( function( k ) { return getSingleKeyInitData( k.kid, initDataType ); } );
+}
+
+function getProprietaryInitDatas( contentitem )
+{
+    var keysWithInitData = contentitem.keys.filter( function( k ) { return k.initData; } );
+    return { initDataType: contentitem.initDataType,
+             initDatas : keysWithInitData.map( function( k ) { return k.initData; } ),
+             variantIds: keysWithInitData.map( function( k ) { return k.variantId; } )
+            };
+}
+
+// Returns a promise that resolves to the following object
+// { supported: boolean,                        // whether the content is supported at all
+//      content: <the content item>,            // the content item description
+//      initDataTypes: <list of initDataTypes>
+// }
+//
+// Note: we test initData types one at a time since some versions of Edge don't support testing several at once
+//
+function isContentSupportedForInitDataTypes( keysystem, initDataTypes, contentitem )
+{
+    return Promise.all( initDataTypes.map( function( initDataType ) {
+        var configuration = {   initDataTypes : [ initDataType ],
+                              audioCapabilities: [ { contentType: contentitem.audio.type } ],
+                              videoCapabilities: [ { contentType: contentitem.video.type } ]
+                          };
+        return navigator.requestMediaKeySystemAccess( keysystem, [ configuration ] ).then( function( access ) {
+            return { supported: true, initDataType: access.getConfiguration().initDataTypes[ 0 ] };
+        }, function() {
+            return { supported: false };
+        } );
+    } ) ).then( function( results ) {
+
+        var initDataTypes = results.filter( function( result ) { return result.supported; } )
+                                    .map( function( result ) { return result.initDataType; } );
+
+        return initDataTypes.length > 0 ?
+                    { content: contentitem, supported: true, initDataTypes: initDataTypes }
+                    : { content: contentitem, supported: false };
+    } );
+}
+
+// Returns a promise that resolves to { content:, supported:, initDataTypes: } object
+function isContentSupported( keysystem, contentitem )
+{
+    return isContentSupportedForInitDataTypes( keysystem, [ 'cenc', 'webm', 'keyids' ], contentitem );
+}
+
+// Returns a Promise resolving to an array of supported content for the key system
+function getSupportedContent( keysystem )
+{
+    return Promise.all( content._items.map( isContentSupported.bind( null, keysystem ) ) ).
+    then( function( results )
+    {
+        return results.filter( function( r ) { return r.supported; } ).map( function( r ) { return r.content; } );
+    } );
+}
+
+// Returns a Promise resolving to an array of { content:, initDataType: } pairs for the key system
+function getSupportedContentAndInitDataTypes( keysystem )
+{
+    return Promise.all( content._items.map( isContentSupported.bind( null, keysystem ) ) ).
+    then( function( results )
+    {
+        return results.filter( function( r ) { return r.supported; } );
+    } );
+}
+
+// gets a configuration object for provided piece of content
+function getSimpleConfigurationForContent( contentitem )
+{
+    return {    initDataTypes: [ 'keyids', 'webm', 'cenc' ],
+                audioCapabilities: [ { contentType: contentitem.audio.type } ],
+                videoCapabilities: [ { contentType: contentitem.video.type } ] };
+}
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_clear_dashinit.mp4 b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_clear_dashinit.mp4
new file mode 100644 (file)
index 0000000..33ac63f
Binary files /dev/null and b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_clear_dashinit.mp4 differ
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_clear_enc_dashinit.mp4 b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_clear_enc_dashinit.mp4
new file mode 100644 (file)
index 0000000..dca2344
Binary files /dev/null and b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_clear_enc_dashinit.mp4 differ
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_dashinit.mp4 b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_dashinit.mp4
new file mode 100644 (file)
index 0000000..53a461e
Binary files /dev/null and b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_dashinit.mp4 differ
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_enc_2keys_2sess.mp4 b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_enc_2keys_2sess.mp4
new file mode 100644 (file)
index 0000000..f59284c
Binary files /dev/null and b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_enc_2keys_2sess.mp4 differ
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_enc_clear_dashinit.mp4 b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_enc_clear_dashinit.mp4
new file mode 100644 (file)
index 0000000..d837ac6
Binary files /dev/null and b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_enc_clear_dashinit.mp4 differ
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_enc_dashinit.mp4 b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_enc_dashinit.mp4
new file mode 100644 (file)
index 0000000..156a799
Binary files /dev/null and b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_enc_dashinit.mp4 differ
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_multikey_dashinit.mp4 b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_multikey_dashinit.mp4
new file mode 100644 (file)
index 0000000..659a61c
Binary files /dev/null and b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_multikey_dashinit.mp4 differ
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_multikey_key2_dashinit.mp4 b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_multikey_key2_dashinit.mp4
new file mode 100644 (file)
index 0000000..0b9b457
Binary files /dev/null and b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_multikey_key2_dashinit.mp4 differ
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/w3c-import.log
new file mode 100644 (file)
index 0000000..ceec57c
--- /dev/null
@@ -0,0 +1,30 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the W3C CSS or WPT github:
+       https://github.com/w3c/csswg-test
+       https://github.com/w3c/web-platform-tests
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/audio_aac-lc_128k_2keys_2sess.mp4
+/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/audio_aac-lc_128k_dashinit.mp4
+/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/audio_aac-lc_128k_enc_dashinit.mp4
+/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/content-metadata.js
+/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_clear_dashinit.mp4
+/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_clear_enc_dashinit.mp4
+/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_dashinit.mp4
+/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_enc_2keys_2sess.mp4
+/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_enc_clear_dashinit.mp4
+/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_enc_dashinit.mp4
+/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_multikey_dashinit.mp4
+/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_multikey_key1_dashinit.mp4
+/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/content/video_512x288_h264-360k_multikey_key2_dashinit.mp4
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-check-initdata-type.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-check-initdata-type.html
new file mode 100644 (file)
index 0000000..194884f
--- /dev/null
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with DRM, mp4</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-initdata-type.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <script>
+        var config = {  keysystem: getSupportedKeySystem() }
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-events-session-closed-event.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-events-session-closed-event.html
new file mode 100644 (file)
index 0000000..8af03ff
--- /dev/null
@@ -0,0 +1,39 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions - Test MediaKeySession closed event with DRM, mp4</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/events-session-closed-event.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentItem = content['mp4-basic'],
+            config = {
+                keysystem: keysystem,
+                content: contentItem,
+                initDataType: contentItem.initDataType,
+                audioType: contentItem.audio.type,
+                videoType: contentItem.video.type
+            };
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-events.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-events.html
new file mode 100644 (file)
index 0000000..bd31397
--- /dev/null
@@ -0,0 +1,71 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Events 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>
+    <script src=/encrypted-media/util/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM servers  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/events.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <script>
+        var keysystem = getSupportedKeySystem();
+
+        getSupportedContentAndInitDataTypes( keysystem )
+        .then( function( supported )
+        {
+            // This test requires initData for supported content.
+            // We prefer explciit initData configured for the content, but
+            // otherwise we will generate initData for a supported initDataType
+            // FIXME: Move me to a utility function
+            var content,
+                initDataType,
+                initData;
+
+            var contentWithExplicitInitData = supported.filter( function( s ) { return s.content.keys && s.content.initDataType; } );
+            if ( contentWithExplicitInitData.length > 0 )
+            {
+                content = contentWithExplicitInitData[ 0 ].content;
+                initDataType = content.keys[ 0 ].initDataType;
+                initData = base64DecodeToUnit8Array( content.keys[ 0 ].initData );
+            }
+            else
+            {
+                content = supported[ 0 ].content;
+                initDataType = supported[ 0 ].initDataTypes[ 0 ];
+                initData = getInitData( content, initDataType );
+            }
+
+            var handler = new MessageHandler( keysystem, content );
+
+            runTest( {  keysystem:          keysystem,
+                        content:            content,
+                        messagehandler:     handler.messagehandler,
+                        initDataType:       initDataType,
+                        initData:           initData
+                    } );
+        } );
+
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-expiration.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-expiration.html
new file mode 100644 (file)
index 0000000..006cac7
--- /dev/null
@@ -0,0 +1,67 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Expiration 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>
+    <script src=/encrypted-media/util/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM servers  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/expiration.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <script>
+        var keysystem = getSupportedKeySystem();
+
+        getSupportedContentAndInitDataTypes( keysystem ).then( function( supported ) {
+            // This test requires initData for supported content.
+            // We prefer explicit initData configured for the content, but
+            // otherwise we will generate initData for a supported initDataType
+            // FIXME: Move me to a utility function
+            var content,
+                initDataType,
+                initData;
+
+            var contentWithExplicitInitData = supported.filter( function( s ) { return s.content.initDataType && s.content.keys; } );
+            if ( contentWithExplicitInitData.length > 0 ) {
+                content = contentWithExplicitInitData[ 0 ].content;
+                initDataType = content.keys[ 0 ].initDataType;
+                initData = base64DecodeToUnit8Array( content.keys[ 0 ].initData );
+            } else {
+                content = supported[ 0 ].content;
+                initDataType = supported[ 0 ].initDataTypes[ 0 ];
+                initData = getInitData( content, initDataType );
+            }
+
+            var handler = new MessageHandler( keysystem, content );
+
+            runTest( {  keysystem:          keysystem,
+                        content:            content,
+                        messagehandler:     handler.messagehandler,
+                        initDataType:       initDataType,
+                        initData:           initData,
+                        expiration:         Date.now().valueOf() + 120000    // Two minutes from now
+                    } );
+        } );
+
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-generate-request-disallowed-input.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-generate-request-disallowed-input.html
new file mode 100644 (file)
index 0000000..d0a75cf
--- /dev/null
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Test handling of invalid initData for generateRequest()</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>
+    <script src=/encrypted-media/util/fetch.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/generate-request-disallowed-input.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <script>
+        var config = {  keysystem:          getSupportedKeySystem()
+                     };
+
+        runTest(config);
+
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-invalid-license.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-invalid-license.html
new file mode 100644 (file)
index 0000000..02d37c1
--- /dev/null
@@ -0,0 +1,32 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Test handling of invalid DRM license</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>
+    <script src=/encrypted-media/util/fetch.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/invalid-license.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            config = {
+                keysystem: keysystem
+            };
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-keystatuses-multiple-sessions.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-keystatuses-multiple-sessions.html
new file mode 100644 (file)
index 0000000..6c86b3f
--- /dev/null
@@ -0,0 +1,55 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with DRM, mp4, multiple keys for audio/video</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM server  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/keystatuses-multiple-sessions.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem();
+        getSupportedContent( keysystem )
+        .then( function( contents ) {
+
+            // Select a content item with multiple keys and initData
+            var contentitem = contents.filter( function( item ) { return item.keys && item.keys.length > 1 && item.initDataType && !item.associatedInitData; } )[ 0 ],
+                handler = new MessageHandler( keysystem, contentitem ),
+                config = {  keysystem:          keysystem,
+                            content:            contentitem,
+                            messagehandler:     handler.messagehandler,
+                            initDataType:       contentitem.initDataType,
+                            initData:           getProprietaryInitDatas(contentitem).initDatas.map( base64DecodeToUnit8Array )
+                        };
+
+            runTest(config);
+
+        } );
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-keystatuses.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-keystatuses.html
new file mode 100644 (file)
index 0000000..87fc06b
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Verify MediaKeySession.keyStatuses with multiple sessions, 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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/keystatuses.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <script>
+        var keysystem = getSupportedKeySystem();
+        getSupportedContent( keysystem ).then( function( contents ) {
+            // Select a content item with multiple keys and initData that retrieves all keys
+            var contentitem = contents.filter( function( item ) {
+                return item.keys && item.keys.length > 1 && item.initDataType && item.associatedInitData;
+            } )[ 0 ];
+
+            var handler = new MessageHandler( keysystem, contentitem );
+            var config = {  keysystem:          keysystem,
+                            content:            contentitem,
+                            messagehandler:     handler.messagehandler,
+                            initDataType:       contentitem.initDataType,
+                            initData:           base64DecodeToUnit8Array( getProprietaryInitDatas(contentitem).initDatas[ 0 ] )
+                        };
+
+            runTest(config);
+
+        } );
+    </script>
+  </body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-onencrypted.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-onencrypted.html
new file mode 100644 (file)
index 0000000..97ffd71
--- /dev/null
@@ -0,0 +1,47 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Encrypted fired on encrypted media file with DRM, mp4</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.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/onencrypted.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+        <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentItem = content['mp4-av-multikey'],
+            config = {
+                video: document.getElementById('videoelement'),
+                content: contentItem,
+                audioType: contentItem.audio.type,
+                videoType: contentItem.video.type,
+                audioPath: contentItem.audio.path,
+                videoPath: contentItem.video.path,
+                initDataType: contentItem.initDataType,
+                keys: contentItem.keys
+            };
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-destroy-persistent-license.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-destroy-persistent-license.html
new file mode 100644 (file)
index 0000000..0794099
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, persistent-license session with DRM, mp4, destroy the license</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM keysystem  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-destroy-persistent-license.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentitem = content['mp4-basic'],
+            handler = new MessageHandler( keysystem, contentitem, 'persistent-license' ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          keysystem,
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       contentitem.initDataType
+                      };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-persistent-license-events.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-persistent-license-events.html
new file mode 100644 (file)
index 0000000..6ccb606
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, persistent-license session with DRM, mp4, event sequence</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM keysystem  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-persistent-license-events.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentitem = content['mp4-basic'],
+            handler = new MessageHandler( keysystem, contentitem, 'persistent-license' ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          keysystem,
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       contentitem.initDataType,
+                       };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-persistent-license.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-persistent-license.html
new file mode 100644 (file)
index 0000000..64764c8
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, persistent-license session with DRM, mp4</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM keysystem  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-persistent-license.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentitem = content['mp4-basic'],
+            handler = new MessageHandler( keysystem, contentitem, 'persistent-license' ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          keysystem,
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       contentitem.initDataType
+                    };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-persistent-usage-record-events.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-persistent-usage-record-events.html
new file mode 100644 (file)
index 0000000..43a6557
--- /dev/null
@@ -0,0 +1,53 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, persistent-usage-record session with DRM, mp4, event sequence</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM servers  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-persistent-usage-record-events.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentitem = content['mp4-basic'],
+            handler = new MessageHandler( keysystem, contentitem, 'persistent-usage-record' ),
+            config = {  video:                  document.getElementById('videoelement'),
+                        keysystem:              keysystem,
+                        messagehandler:         handler.messagehandler,
+                        audioPath:              contentitem.audio.path,
+                        videoPath:              contentitem.video.path,
+                        audioType:              contentitem.audio.type,
+                        videoType:              contentitem.video.type,
+                        initDataType:           contentitem.initDataType,
+                        servercertificate:      handler.servercertificate
+                      };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-persistent-usage-record.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-persistent-usage-record.html
new file mode 100644 (file)
index 0000000..d9eb4fd
--- /dev/null
@@ -0,0 +1,54 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <meta name="timeout" content="long">
+    <title>Encrypted Media Extensions: Successful Playback, persistent-usage-record session with DRM, mp4</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM servers  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-persistent-usage-record.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentitem = content['mp4-basic'],
+            handler = new MessageHandler( keysystem, contentitem, 'persistent-usage-record' ),
+            config = {  video:                  document.getElementById('videoelement'),
+                        keysystem:              keysystem,
+                        messagehandler:         handler.messagehandler,
+                        audioPath:              contentitem.audio.path,
+                        videoPath:              contentitem.video.path,
+                        audioType:              contentitem.audio.type,
+                        videoType:              contentitem.video.type,
+                        initDataType:           contentitem.initDataType,
+                        servercertificate:      handler.servercertificate
+                      };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-retrieve-destroy-persistent-license.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-retrieve-destroy-persistent-license.html
new file mode 100644 (file)
index 0000000..053a09e
--- /dev/null
@@ -0,0 +1,54 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <meta name="timeout" content="long">
+    <title>Encrypted Media Extensions: Successful Playback, persistent-license session with DRM, mp4, retrieve license, playback and destroy the license</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM keysystem  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-retrieve-persistent-license.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentitem = content['mp4-basic'],
+            handler = new MessageHandler( keysystem, contentitem, 'persistent-license' ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          keysystem,
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       contentitem.initDataType,
+                        windowscript:       'resources/drm-retrieve-destroy-persistent-license.html',
+                        testcase:           'playback, retrieve, playback and destroy' };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-retrieve-persistent-license.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-retrieve-persistent-license.html
new file mode 100644 (file)
index 0000000..d2122d6
--- /dev/null
@@ -0,0 +1,54 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <meta name="timeout" content="long">
+    <title>Encrypted Media Extensions: Successful Playback, persistent-license session with DRM, mp4, retrieve the license, playback</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM keysystem  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-retrieve-persistent-license.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentitem = content['mp4-basic'],
+            handler = new MessageHandler( keysystem, contentitem, 'persistent-license' ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          keysystem,
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       contentitem.initDataType,
+                        windowscript:       'resources/drm-retrieve-persistent-license.html',
+                        testcase:           'playback, retrieve, playback' };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-retrieve-persistent-usage-record.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-retrieve-persistent-usage-record.html
new file mode 100644 (file)
index 0000000..8f1e951
--- /dev/null
@@ -0,0 +1,53 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: persistent-usage-record, playback and retrieve record in new window,  DRM, mp4</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM server  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-retrieve-persistent-usage-record.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentitem = content['mp4-basic'],
+            handler = new MessageHandler( keysystem, contentitem, 'persistent-usage-record' ),
+            config = {  video:                  document.getElementById('videoelement'),
+                        keysystem:              keysystem,
+                        messagehandler:         handler.messagehandler,
+                        audioPath:              contentitem.audio.path,
+                        videoPath:              contentitem.video.path,
+                        audioType:              contentitem.audio.type,
+                        videoType:              contentitem.video.type,
+                        initDataType:           contentitem.initDataType,
+                        servercertificate:      handler.servercertificate,
+                        windowscript:           'resources/drm-retrieve-persistent-usage-record.html' };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-clear-encrypted.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-clear-encrypted.html
new file mode 100644 (file)
index 0000000..e5cd1fd
--- /dev/null
@@ -0,0 +1,53 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with DRM, mp4, clear then encrypted</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>
+    <script src=/encrypted-media/util/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM servers  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentitem = content['mp4-clear-encrypted'],
+            handler = new MessageHandler(keysystem, contentitem),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          keysystem,
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       contentitem.initDataType,
+                        testcase:           'single key, clear then encrypted content',
+                        duration:           4 };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-encrypted-clear-sources.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-encrypted-clear-sources.html
new file mode 100644 (file)
index 0000000..79de9ad
--- /dev/null
@@ -0,0 +1,58 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, alternate Encrypted and Clear playbacks, Temporary, mp4, 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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary-encrypted-clear-sources.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            encryptedcontentitem = content['mp4-basic'],
+            clearcontentitem = content['mp4-clear'],
+            handler = new MessageHandler(keysystem, encryptedcontentitem),
+            configEncrypted = { video:              document.getElementById('videoelement'),
+                                keysystem:          keysystem,
+                                messagehandler:     handler.messagehandler,
+                                audioPath:          encryptedcontentitem.audio.path,
+                                videoPath:          encryptedcontentitem.video.path,
+                                audioType:          encryptedcontentitem.audio.type,
+                                videoType:          encryptedcontentitem.video.type,
+                                initDataType:       encryptedcontentitem.initDataType
+                            },
+            configClear = { audioPath:          clearcontentitem.audio.path,
+                            videoPath:          clearcontentitem.video.path,
+                            audioType:          clearcontentitem.audio.type,
+                            videoType:          clearcontentitem.video.type,
+                            };
+
+        runTest(configEncrypted,configClear);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-encrypted-clear.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-encrypted-clear.html
new file mode 100644 (file)
index 0000000..c1627ad
--- /dev/null
@@ -0,0 +1,53 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with DRM, mp4, encrypted then clear</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>
+    <script src=/encrypted-media/util/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM servers  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentitem = content['mp4-encrypted-clear'],
+            handler = new MessageHandler(keysystem, contentitem),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          keysystem,
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       contentitem.initDataType,
+                        testcase:           'single key, clear then encrypted content',
+                        duration:           4 };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-events.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-events.html
new file mode 100644 (file)
index 0000000..8b21657
--- /dev/null
@@ -0,0 +1,53 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <meta name="timeout" content="long">
+    <title>Encrypted Media Extensions: Successful playback, temporary session with DRM, mp4, validating events</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>
+    <script src=/encrypted-media/util/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM servers  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary-events.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentitem = content['mp4-basic'],
+            handler = new MessageHandler( keysystem, contentitem ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          keysystem,
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       contentitem.initDataType
+                      };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-expired.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-expired.html
new file mode 100644 (file)
index 0000000..56c413d
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with DRM, mp4, expired license</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>
+    <script src=/encrypted-media/util/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM servers  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary-expired.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentitem = content['mp4-basic'],
+            handler = new MessageHandler(keysystem, contentitem),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          keysystem,
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       contentitem.initDataType
+                      };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-multikey-sequential-readyState.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-multikey-sequential-readyState.html
new file mode 100644 (file)
index 0000000..cc83575
--- /dev/null
@@ -0,0 +1,58 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <meta name="timeout" content="long">
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with DRM, mp4, multiple keys in sequence, check readyState</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary-multikey-sequential.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentitem = content['mp4-multikey-sequential'],
+            handler = new MessageHandler(keysystem, contentitem),
+            initdatas = getProprietaryInitDatas(contentitem),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          keysystem,
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       contentitem.initDataType,
+                        initData:           initdatas.initDatas.map(base64DecodeToUnit8Array),
+                        variantIds:         initdatas.variantIds,
+                        duration:           5,
+                        checkReadyState:    true
+                    };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-multikey-sequential.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-multikey-sequential.html
new file mode 100644 (file)
index 0000000..41cb302
--- /dev/null
@@ -0,0 +1,57 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <meta name="timeout" content="long">
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with DRM, mp4, multiple keys in sequence</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for Clear Key keysystem  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary-multikey-sequential.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentitem = content['mp4-multikey-sequential'],
+            handler = new MessageHandler( keysystem, contentitem ),
+            initdatas = getProprietaryInitDatas(contentitem),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          keysystem,
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       contentitem.initDataType,
+                        initData:           initdatas.initDatas.map(base64DecodeToUnit8Array),
+                        variantIds:         initdatas.variantIds,
+                        duration:           5
+                    };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-multikey.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-multikey.html
new file mode 100644 (file)
index 0000000..65bdb6e
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful playback, temporary session with DRM, mp4, multiple keys</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM keysystem  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentitem = content['mp4-av-multikey'],
+            handler = new MessageHandler( keysystem, contentitem ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          keysystem,
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       contentitem.initDataType,
+                        testcase:           'multikey audio/video'
+                        };
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-multisession.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-multisession.html
new file mode 100644 (file)
index 0000000..e0a47b9
--- /dev/null
@@ -0,0 +1,55 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Verify MediaKeySession.keyStatuses with multiple sessions, 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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM keysystem  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary-multisession.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentitem = content['mp4-multikey'],
+            handler = new MessageHandler( keysystem, contentitem ),
+            proprietaryInitDatas = getProprietaryInitDatas(contentitem),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          keysystem,
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       contentitem.initDataType,
+                        initData:           proprietaryInitDatas.initDatas.map( base64DecodeToUnit8Array ),
+                        variantIds:         proprietaryInitDatas.variantIds,
+                        testcase:           'multikey video' };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-setMediaKeys-after-src.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-setMediaKeys-after-src.html
new file mode 100644 (file)
index 0000000..3d204d6
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with DRM, mp4</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>
+    <script src=/encrypted-media/util/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM servers  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary-setMediaKeys.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentitem = content['mp4-basic'],
+            handler = new MessageHandler( keysystem, contentitem ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          keysystem,
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       contentitem.initDataType,
+                        testcase:           SETMEDIAKEYS_AFTER_SRC };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-setMediaKeys-after-update.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-setMediaKeys-after-update.html
new file mode 100644 (file)
index 0000000..315eef3
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with DRM, mp4</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>
+    <script src=/encrypted-media/util/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM servers  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary-setMediaKeys.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentitem = content['mp4-basic'],
+            handler = new MessageHandler( keysystem, contentitem ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          keysystem,
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       contentitem.initDataType,
+                        testcase:           SETMEDIAKEYS_AFTER_UPDATE };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-setMediaKeys-immediately.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-setMediaKeys-immediately.html
new file mode 100644 (file)
index 0000000..b9bac1b
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with DRM, mp4</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>
+    <script src=/encrypted-media/util/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM servers  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary-setMediaKeys.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentitem = content['mp4-basic'],
+            handler = new MessageHandler( keysystem, contentitem ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          keysystem,
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       contentitem.initDataType,
+                        testcase:           SETMEDIAKEYS_IMMEDIATELY };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-setMediaKeys-onencrypted.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-setMediaKeys-onencrypted.html
new file mode 100644 (file)
index 0000000..73c6869
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with DRM, mp4</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>
+    <script src=/encrypted-media/util/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM servers  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary-setMediaKeys.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentitem = content['mp4-basic'],
+            handler = new MessageHandler( keysystem, contentitem ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          keysystem,
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       contentitem.initDataType,
+                        testcase:           SETMEDIAKEYS_ONENCRYPTED };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-two-videos.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-two-videos.html
new file mode 100644 (file)
index 0000000..1827973
--- /dev/null
@@ -0,0 +1,54 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with DRM, mp4, two videos</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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM server  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary-two-videos.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement1" width="200px"></video>
+      <video id="videoelement2" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentitem = content['mp4-basic'],
+            handler = new MessageHandler( keysystem, contentitem ),
+            config = {  video:              [   document.getElementById( 'videoelement1' ),
+                                                document.getElementById( 'videoelement2' ) ],
+                        keysystem:          keysystem,
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       contentitem.initDataType
+                       };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-waitingforkey.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary-waitingforkey.html
new file mode 100644 (file)
index 0000000..4ea10ce
--- /dev/null
@@ -0,0 +1,53 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Verify MediaKeySession.keyStatuses with multiple sessions, 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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/utf8.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM keysystem  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary-waitingforkey.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentitem = content['mp4-basic'],
+            keysystem = getSupportedKeySystem(),
+            handler = new MessageHandler( keysystem, contentitem ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          keysystem,
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       contentitem.initDataType,
+                        initData:           getProprietaryInitDatas(contentitem).initDatas.map( base64DecodeToUnit8Array ),
+                    };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-playback-temporary.html
new file mode 100644 (file)
index 0000000..b969035
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Successful Playback, Temporary session with DRM, mp4</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>
+    <script src=/encrypted-media/util/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM servers  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/playback-temporary.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentitem = content['mp4-basic'],
+            handler = new MessageHandler( keysystem, contentitem ),
+            config = {  video:              document.getElementById('videoelement'),
+                        keysystem:          keysystem,
+                        messagehandler:     handler.messagehandler,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       contentitem.initDataType,
+                        testcase:           'single key' };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-requestmediakeysystemaccess.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-requestmediakeysystemaccess.html
new file mode 100644 (file)
index 0000000..be66f06
--- /dev/null
@@ -0,0 +1,41 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <meta name="timeout" content="long">
+    <title>Encrypted Media Extensions: requestMediaKeySystemAccess tests, 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/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.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/requestmediakeysystemaccess.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <script>
+        var contentitem = content['mp4-basic'],
+            keySystem = getSupportedKeySystem(),
+            config = {  keysystem:          keySystem,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type,
+                        initDataType:       getSupportedInitDataTypes( keySystem )[ 0 ]
+                    };
+
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-reset-src-after-setmediakeys.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-reset-src-after-setmediakeys.html
new file mode 100644 (file)
index 0000000..499b711
--- /dev/null
@@ -0,0 +1,46 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions - Reset MediaSource after setMediaKeys for DRM, mp4</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>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/fetch.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/reset-src-after-setmediakeys.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentItem = content['mp4-av-multikey'],
+            keysystem = getSupportedKeySystem(),
+            config = {
+                video: document.getElementById('videoelement'),
+                keysystem: keysystem,
+                content: contentItem,
+                initDataType: contentItem.initDataType,
+                audioType: contentItem.audio.type,
+                videoType: contentItem.video.type,
+                audioPath: contentItem.audio.path,
+                videoPath: contentItem.video.path,
+            };
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-setmediakeys-again-after-playback.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-setmediakeys-again-after-playback.html
new file mode 100644 (file)
index 0000000..b624ee3
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: setMediaKeys again after playback 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>
+    <script src=/encrypted-media/util/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM servers  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/setmediakeys-again-after-playback.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentitem = content['mp4-basic'],
+            handler = new MessageHandler(keysystem, contentitem );
+        getSupportedContent( keysystem ).then( function( contents ) {
+            runTest( {  video:              document.getElementById('videoelement'),
+                        keysystem:          keysystem,
+                        messagehandler:     handler.messagehandler,
+                        content:            contentitem,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type
+                     } );
+        } );
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-setmediakeys-again-after-resetting-src.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-setmediakeys-again-after-resetting-src.html
new file mode 100644 (file)
index 0000000..e7ceae9
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: setMediaKeys again after resetting src attribute on video element 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>
+    <script src=/encrypted-media/util/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM servers  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/setmediakeys-again-after-resetting-src.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentitem = content['mp4-basic'],
+            handler = new MessageHandler(keysystem, contentitem );
+        getSupportedContent( keysystem ).then( function( contents ) {
+            runTest( {  video:              document.getElementById('videoelement'),
+                        keysystem:          keysystem,
+                        messagehandler:     handler.messagehandler,
+                        content:            contentitem,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type
+                     } );
+        } );
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-setmediakeys-at-same-time.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-setmediakeys-at-same-time.html
new file mode 100644 (file)
index 0000000..1695c55
--- /dev/null
@@ -0,0 +1,44 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: setMediaKeys multiple at same time 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>
+    <script src=/encrypted-media/util/fetch.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM servers  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/setmediakeys-at-same-time.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem();
+        getSupportedContent( keysystem ).then( function( contents ) {
+            runTest( {  video:              document.getElementById('videoelement'),
+                        keysystem:          keysystem,
+                        content:            contents[ 0 ]
+                     } );
+        } );
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-setmediakeys-multiple-times-with-different-mediakeys.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-setmediakeys-multiple-times-with-different-mediakeys.html
new file mode 100644 (file)
index 0000000..554a754
--- /dev/null
@@ -0,0 +1,50 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: setMediaKeys multiple times with different mediakeys 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>
+    <script src=/encrypted-media/util/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM servers  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/setmediakeys-multiple-times-with-different-mediakeys.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentitem = content['mp4-basic'];
+        getSupportedContent( keysystem ).then( function( contents ) {
+            runTest( {  video:              document.getElementById('videoelement'),
+                        keysystem:          keysystem,
+                        content:            contentitem,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type
+                     } );
+        } );
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-setmediakeys-multiple-times-with-the-same-mediakeys.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-setmediakeys-multiple-times-with-the-same-mediakeys.html
new file mode 100644 (file)
index 0000000..d0d9eab
--- /dev/null
@@ -0,0 +1,50 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: setMediaKeys multiple times with the same mediakeys 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>
+    <script src=/encrypted-media/util/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM servers  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/setmediakeys-multiple-times-with-the-same-mediakeys.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem(),
+            contentitem = content['mp4-basic'];
+        getSupportedContent( keysystem ).then( function( contents ) {
+            runTest( {  video:              document.getElementById('videoelement'),
+                        keysystem:          keysystem,
+                        content:            contentitem,
+                        audioPath:          contentitem.audio.path,
+                        videoPath:          contentitem.video.path,
+                        audioType:          contentitem.audio.type,
+                        videoType:          contentitem.video.type
+                     } );
+        } );
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-setmediakeys-to-multiple-video-elements.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-setmediakeys-to-multiple-video-elements.html
new file mode 100644 (file)
index 0000000..239bdf9
--- /dev/null
@@ -0,0 +1,48 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: setMediaKeys to multiple video elements 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>
+    <script src=/encrypted-media/util/fetch.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM servers  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/setmediakeys-to-multiple-video-elements.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video1'>
+      <video id="videoelement1" width="200px"></video>
+    </div>
+    <div id='video2'>
+      <video id="videoelement2" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem();
+        getSupportedContent( keysystem ).then( function( contents ) {
+            runTest( {  video1:              document.getElementById('videoelement1'),
+                        video2:              document.getElementById('videoelement2'),
+                        keysystem:          keysystem,
+                        content:            contents[ 0 ]
+                     } );
+        } );
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-setmediakeys.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-setmediakeys.html
new file mode 100644 (file)
index 0000000..dda1975
--- /dev/null
@@ -0,0 +1,44 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: setMediaKeys 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>
+    <script src=/encrypted-media/util/fetch.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM servers  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/setmediakeys.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var keysystem = getSupportedKeySystem();
+        getSupportedContent( keysystem ).then( function( contents ) {
+            runTest( {  video:              document.getElementById('videoelement'),
+                        keysystem:          keysystem,
+                        content:            contents[ 0 ]
+                     } );
+        } );
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-syntax-mediakeys.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-syntax-mediakeys.html
new file mode 100644 (file)
index 0000000..2edd432
--- /dev/null
@@ -0,0 +1,43 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions - Test MediaKeys attribute, setServerCertificate and setServerCertificate exception syntax for DRM, mp4</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>
+    <script src=/encrypted-media/util/fetch.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/syntax-mediakeys.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+    <script>
+        var keysystem = getSupportedKeySystem();
+        var contentItem = content['mp4-basic'],
+            config = {
+                keysystem: keysystem,
+                content: contentItem,
+                initData: stringToUint8Array(atob(contentItem.keys[0].initData)),
+                initDataType: contentItem.initDataType,
+                audioType: contentItem.audio.type,
+                videoType: contentItem.video.type
+            };
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-syntax-mediakeysession.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-syntax-mediakeysession.html
new file mode 100644 (file)
index 0000000..98395a7
--- /dev/null
@@ -0,0 +1,43 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions - Test MediaKeySession attribute and function syntax for DRM, mp4</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>
+    <script src=/encrypted-media/util/fetch.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/syntax-mediakeysession.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+    <script>
+        var keysystem = getSupportedKeySystem();
+        var contentItem = content['mp4-basic'],
+            config = {
+                keysystem: keysystem,
+                content: contentItem,
+                initData: stringToUint8Array(atob(contentItem.keys[0].initData)),
+                initDataType: contentItem.initDataType,
+                audioType: contentItem.audio.type,
+                videoType: contentItem.video.type
+            };
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-syntax-mediakeysystemaccess.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-syntax-mediakeysystemaccess.html
new file mode 100644 (file)
index 0000000..0a44047
--- /dev/null
@@ -0,0 +1,43 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions - Test navigator.requestmediakeysystemaccess exception and MediaKeySystemAccess attribute syntax for DRM, mp4</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>
+    <script src=/encrypted-media/util/fetch.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/syntax-mediakeysystemaccess.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+    <script>
+        var keysystem = getSupportedKeySystem();
+        var contentItem = content['mp4-basic'],
+            config = {
+                keysystem: keysystem,
+                content: contentItem,
+                initData: stringToUint8Array(atob(contentItem.keys[0].initData)),
+                initDataType: contentItem.initDataType,
+                audioType: contentItem.audio.type,
+                videoType: contentItem.video.type
+            };
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-unique-origin.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-unique-origin.html
new file mode 100644 (file)
index 0000000..403489d
--- /dev/null
@@ -0,0 +1,44 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Unique origin with DRM, mp4</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>
+    <script src=/encrypted-media/util/fetch.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/unique-origin.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+    <div id='video'>
+        <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentItem = content['mp4-av-multikey'],
+            keysystem = getSupportedKeySystem(),
+            config = {
+                video: document.getElementById('videoelement'),
+                keysystem: keysystem,
+                initDataType: contentItem.initDataType,
+                audioType: contentItem.audio.type,
+                videoType: contentItem.video.type,
+                audioPath: contentItem.audio.path,
+                videoPath: contentItem.video.path
+            };
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-waiting-for-a-key.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-mp4-waiting-for-a-key.html
new file mode 100644 (file)
index 0000000..6f58fc0
--- /dev/null
@@ -0,0 +1,52 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions - Waiting for a key for DRM, mp4</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>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+    <script src=/encrypted-media/util/fetch.js></script>
+
+    <!--  Message handler for DRM servers  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/waiting-for-a-key.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+    <div id='video'>
+      <video id="videoelement" width="200px"></video>
+    </div>
+
+    <script>
+        var contentItem = content['mp4-basic'],
+            keysystem = getSupportedKeySystem(),
+            handler = new MessageHandler( keysystem, contentItem ),
+            config = {
+                video: document.getElementById('videoelement'),
+                keysystem: keysystem,
+                content: contentItem,
+                messageHandler: handler.messagehandler,
+                initDataType: contentItem.initDataType,
+                audioType: contentItem.audio.type,
+                videoType: contentItem.video.type,
+                audioPath: contentItem.audio.path,
+                videoPath: contentItem.video.path,
+            };
+        runTest(config);
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-not-callable-after-createsession.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-not-callable-after-createsession.html
new file mode 100644 (file)
index 0000000..f251f5a
--- /dev/null
@@ -0,0 +1,35 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Test MediaKeySession not callable immediately after CreateSession(), 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>
+    <script src=/encrypted-media/util/fetch.js></script>
+
+    <!--  Message handler for DRM server  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/not-callable-after-createsession.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <script>
+        var config = {  keysystem:          getSupportedKeySystem()
+                     };
+
+        runTest(config);
+
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-temporary-license-type.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/drm-temporary-license-type.html
new file mode 100644 (file)
index 0000000..8e8800f
--- /dev/null
@@ -0,0 +1,71 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extensions: Test that persistent license cannot be ingested into temporary session</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>
+    <script src=/encrypted-media/util/fetch.js></script>
+    <script src=/encrypted-media/util/testmediasource.js></script>
+
+    <!--  Content metadata  -->
+    <script src=/encrypted-media/content/content-metadata.js></script>
+
+    <!--  Message handler for DRM servers  -->
+    <script src=/encrypted-media/util/drm-messagehandler.js></script>
+
+    <!--  The script for this specific test  -->
+    <script src=/encrypted-media/scripts/temporary-license-type.js></script>
+
+  </head>
+  <body>
+    <div id='log'></div>
+
+    <script>
+        var keysystem = getSupportedKeySystem();
+
+        getSupportedContentAndInitDataTypes( keysystem )
+        .then( function( supported )
+        {
+            // This test requires initData for supported content.
+            // We prefer explicit initData configured for the content, but
+            // otherwise we will generate initData for a supported initDataType
+            // FIXME: Move me to a utility function
+            var content,
+                initDataType,
+                initData;
+
+            var contentWithExplicitInitData = supported.filter( function( s ) { return s.content.keys && s.content.initDataType; } );
+            if ( contentWithExplicitInitData.length > 0 )
+            {
+                content = contentWithExplicitInitData[ 0 ].content;
+                initDataType = content.keys[ 0 ].initDataType;
+                initData = base64DecodeToUnit8Array( content.keys[ 0 ].initData );
+            }
+            else
+            {
+                content = supported[ 0 ].content;
+                initDataType = supported[ 0 ].initDataTypes[ 0 ];
+                initData = getInitData( content, initDataType );
+            }
+
+            var handler = new MessageHandler( keysystem, content, 'persistent-license' );
+
+            runTest( {  keysystem:          keysystem,
+                        content:            content,
+                        messagehandler:     handler.messagehandler,
+                        initDataType:       initDataType,
+                        initData:           initData
+                    } );
+        } );
+
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/idlharness.html b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/idlharness.html
new file mode 100644 (file)
index 0000000..e65ad5e
--- /dev/null
@@ -0,0 +1,51 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset=utf-8>
+    <title>Encrypted Media Extentions IDL test</title>
+    <link rel="help" href="https://w3c.github.io/encrypted-media/">
+
+    <script src=/resources/testharness.js></script>
+    <script src=/resources/testharnessreport.js></script>
+    <script src=/resources/WebIDLParser.js></script>
+    <script src=/resources/idlharness.js></script>
+    <script src=/encrypted-media/util/fetch.js></script>
+  </head>
+  <body>
+    <h1 class="instructions">Description</h1>
+    <p class="instructions">
+      This test verifies that implementations of the Encrypted Media Extensions API match its WebIDL definition.
+    </p>
+
+    <div id='log'></div>
+
+    <script>
+        setup(function() {
+
+            fetch( 'EncryptedMediaExtensions.idl')
+            .then( function( response ) {
+                if ( !response.ok ) throw new Error( 'IDL fetch failed' );
+                return response.text();
+            } )
+            .then( function( idls ) {
+
+                var idl_array = new IdlArray();
+                idl_array.add_untested_idls("[PrimaryGlobal] interface Window {};");
+                idl_array.add_untested_idls("interface Navigator {};");
+                idl_array.add_untested_idls("interface ArrayBuffer {};");
+                idl_array.add_untested_idls("interface HTMLMediaElement {};");
+                idl_array.add_untested_idls("interface Event {};");
+                idl_array.add_untested_idls("interface EventTarget {};");
+
+                idl_array.add_idls(idls);
+
+                idl_array.test();
+
+                done();
+
+            } );
+
+        }, {explicit_done: true});
+    </script>
+  </body>
+</html>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/polyfill/cast-polyfill.js b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/polyfill/cast-polyfill.js
new file mode 100644 (file)
index 0000000..576e0ad
--- /dev/null
@@ -0,0 +1,80 @@
+(function() {
+
+    if ( /CrKey\/[0-9]+\.[0-9a-z]+\.[0-9a-z]+/i.exec( navigator.userAgent ) ) {
+
+        var castscript = document.createElement('script');
+        castscript.type = 'text/javascript';
+        castscript.src = 'https://www.gstatic.com/cast/sdk/libs/receiver/2.0.0/cast_receiver.js'
+        document.head.appendChild( castscript );
+
+        var _requestMediaKeySystemAccess = navigator.requestMediaKeySystemAccess.bind( navigator ),
+            _setMediaKeys = HTMLMediaElement.prototype.setMediaKeys,
+            _load = MediaKeySession.prototype.load;
+
+        MediaKeySession.prototype.load = function load()
+        {
+            return _load.call( this ).then( function( success )
+            {
+                return success ? this.remove() : false;
+            }.bind( this ) );
+        };
+
+        function MediaKeys( mediaKeys )
+        {
+            this._mediaKeys = mediaKeys;
+        }
+
+        MediaKeys.prototype.setServerCertificate = function setServerCertificate( certificate )
+        {
+            return this._mediaKeys.setServerCertificate( certificate );
+        };
+
+        MediaKeys.prototype.createSession = function createSession( sessionType ) {
+
+            if ( sessionType === 'persistent-usage-record' )
+            {
+                return cast.receiver.eme.KeySession.createSession( this._mediaKeys, 'persistent-release-message' );
+            }
+
+            return this._mediaKeys.createSession( sessionType );
+        };
+
+        function MediaKeySystemAccess( access )
+        {
+            this._access = mediaKeySystemAccess;
+        }
+
+        Object.defineProperty( MediaKeySystemAccess.prototype, 'keySystem', { get: function() { return this._access.keySystem; } } );
+
+        MediaKeySystemAccess.prototype.getConfiguration = function getConfiguration() { return this._access.getConfiguration(); };
+
+        MediaKeySystemAccess.prototype.createMediaKeys = function createMediaKeys() {
+
+            return this._access.createMediaKey().then( function( mediaKeys ) { return new MediaKeys( mediaKeys ); } );
+
+        };
+
+        HTMLMediaElement.prototype.setMediaKeys = function setMediaKeys( mediaKeys )
+        {
+            if ( mediaKeys instanceof MediaKeys )
+            {
+                return _setMediaKeys.call( this, mediaKeys._mediaKeys );
+            }
+            else
+            {
+                return _setMediaKeys.call( this, mediaKeys );
+            }
+        };
+
+        navigator.requestMediaKeySystemAccess = function requestMediaKeySystemAccess( keysystem, supportedConfigurations ) {
+
+            if ( keysystem !== 'com.chromecast.playready' )
+            {
+                return _requestMediaKeySystemAccess( keysystem, supportedConfigurations );
+            }
+
+            return _requestMediaKeySystemAccess( keysystem, supportedConfigurations )
+            .then( function( access ) { return new MediaKeySystemAccess( access ); } );
+        };
+    }
+})();
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/polyfill/chrome-polyfill.js b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/polyfill/chrome-polyfill.js
new file mode 100644 (file)
index 0000000..2f11497
--- /dev/null
@@ -0,0 +1,37 @@
+(function(){
+    if( navigator.userAgent.toLowerCase().indexOf('edge') === -1
+            && navigator.userAgent.toLowerCase().indexOf('chrome') > -1){
+
+        if ( ( /chrome\/([0-9]*)\./.exec( navigator.userAgent.toLowerCase() )[1] | 0 ) < 54 ) {
+
+            // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=622956
+            // Chrome does not fire the empty keystatuschange event when a session is closed
+            var _mediaKeySessionClose = MediaKeySession.prototype.close;
+            var _mediaKeySessionKeyStatusesGetter = Object.getOwnPropertyDescriptor( MediaKeySession.prototype, 'keyStatuses' ).get;
+            var _emptyMediaKeyStatusMap = { size: 0,
+                                            has:    function() { return false; },
+                                            get:    function() { return undefined; },
+                                            entries:function() { return []; },          // this may not be correct, I think it should be some iterator thing
+                                            keys:   function() { return []; },
+                                            values: function() { return []; },
+                                            forEach:function() { return; } };
+
+            MediaKeySession.prototype.close = function close()
+            {
+                this.__closed = true;
+
+                setTimeout( function() {
+                        this.dispatchEvent( new Event( 'keystatuseschange' ) );
+                }.bind( this ), 0 );
+
+                return _mediaKeySessionClose.call( this );
+            };
+
+            Object.defineProperty( MediaKeySession.prototype, 'keyStatuses', { get: function() {
+
+                return this.__closed ? _emptyMediaKeyStatusMap : _mediaKeySessionKeyStatusesGetter.call( this );
+
+            } } );
+        }
+    }
+}());
diff --git a/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/polyfill/clearkey-polyfill.js b/LayoutTests/imported/w3c/web-platform-tests/encrypted-media/polyfill/clearkey-polyfill.js
new file mode 100644 (file)
index 0000000..057ea3e
--- /dev/null
@@ -0,0 +1,510 @@
+(function(){
+
+    // Save platform functions that will be modified
+    var _requestMediaKeySystemAccess = navigator.requestMediaKeySystemAccess.bind( navigator ),
+        _setMediaKeys = HTMLMediaElement.prototype.setMediaKeys;
+
+    // Allow us to modify the target of Events
+    Object.defineProperties( Event.prototype, {
+        target: {   get: function() { return this._target || this.currentTarget; },
+                    set: function( newtarget ) { this._target = newtarget; } }
+    } );
+
+    var EventTarget = function(){
+        this.listeners = {};
+    };
+
+    EventTarget.prototype.listeners = null;
+
+    EventTarget.prototype.addEventListener = function(type, callback){
+      if(!(type in this.listeners)) {
+        this.listeners[type] = [];
+      }
+      this.listeners[type].push(callback);
+    };
+
+    EventTarget.prototype.removeEventListener = function(type, callback){
+      if(!(type in this.listeners)) {
+        return;
+      }
+      var stack = this.listeners[type];
+      for(var i = 0, l = stack.length; i < l; i++){
+        if(stack[i] === callback){
+          stack.splice(i, 1);
+          return this.removeEventListener(type, callback);
+        }
+      }
+    };
+
+    EventTarget.prototype.dispatchEvent = function(event){
+      if(!(event.type in this.listeners)) {
+        return;
+      }
+      var stack = this.listeners[event.type];
+      event.target = this;
+      for(var i = 0, l = stack.length; i < l; i++) {
+        stack[i].call(this, event);
+      }
+    };
+
+    function MediaKeySystemAccessProxy( keysystem, access, configuration )
+    {
+        this._keysystem = keysystem;
+        this._access = access;
+        this._configuration = configuration;
+    }
+
+    Object.defineProperties( MediaKeySystemAccessProxy.prototype, {
+        keysystem: { get: function() { return this._keysystem; } }
+    });
+
+    MediaKeySystemAccessProxy.prototype.getConfiguration = function getConfiguration()
+    {
+        return this._configuration;
+    };
+
+    MediaKeySystemAccessProxy.prototype.createMediaKeys = function createMediaKeys()
+    {
+        return new Promi