diff options
author | Moonchild <moonchild@palemoon.org> | 2021-02-25 01:03:57 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2021-02-25 01:03:57 +0000 |
commit | ceadffab6b357723981a429e11222daf6cd6dcfb (patch) | |
tree | 5603053048d6a460f79b22bdf165fb74d32d39b0 /testing/web-platform/tests/encrypted-media/scripts/events.js | |
parent | 14fb2f966e9b54598c451e3cb35b4aa0480dafed (diff) | |
parent | ad5a13bd501e379517da1a944c104a11d951a3f5 (diff) | |
download | UXP-RC_20210225.tar UXP-RC_20210225.tar.gz UXP-RC_20210225.tar.lz UXP-RC_20210225.tar.xz UXP-RC_20210225.zip |
Merge branch 'master' into releaseRC_20210225
Diffstat (limited to 'testing/web-platform/tests/encrypted-media/scripts/events.js')
-rw-r--r-- | testing/web-platform/tests/encrypted-media/scripts/events.js | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/testing/web-platform/tests/encrypted-media/scripts/events.js b/testing/web-platform/tests/encrypted-media/scripts/events.js deleted file mode 100644 index 85c86ae78..000000000 --- a/testing/web-platform/tests/encrypted-media/scripts/events.js +++ /dev/null @@ -1,59 +0,0 @@ -function runTest(config,qualifier) { - - var testname = testnamePrefix(qualifier, config.keysystem) + ', basic events'; - - var configuration = getSimpleConfigurationForContent(config.content); - - if (config.initDataType && config.initData) { - configuration.initDataTypes = [config.initDataType]; - } - - async_test(function(test) - { - var initDataType; - var initData; - var mediaKeySession; - - function onFailure(error) { - forceTestFailureFromPromise(test, error); - } - - function processMessage(event) - { - assert_true(event instanceof window.MediaKeyMessageEvent); - assert_equals(event.target, mediaKeySession); - assert_equals(event.type, 'message'); - assert_in_array(event.messageType,['license-request', 'individualization-request']); - - config.messagehandler( event.messageType, event.message ).then(function(response) { - waitForEventAndRunStep('keystatuseschange', mediaKeySession, test.step_func(processKeyStatusesChange), test); - return mediaKeySession.update( response ); - }).catch(onFailure); - } - - function processKeyStatusesChange(event) - { - assert_true(event instanceof Event); - assert_equals(event.target, mediaKeySession); - assert_equals(event.type, 'keystatuseschange'); - test.done(); - } - - navigator.requestMediaKeySystemAccess(config.keysystem,[configuration]).then(function(access) { - initDataType = access.getConfiguration().initDataTypes[0]; - - if (config.initDataType && config.initData) { - initData = config.initData; - } else { - initData = getInitData(config.content, initDataType); - } - - return access.createMediaKeys(); - }).then(test.step_func(function(mediaKeys) { - mediaKeySession = mediaKeys.createSession(); - waitForEventAndRunStep('message', mediaKeySession, test.step_func(processMessage), test); - return mediaKeySession.generateRequest(initDataType, initData); - })).catch(onFailure); - }, testname ); - -} |