summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/encrypted-media/scripts/setmediakeys-to-multiple-video-elements.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/encrypted-media/scripts/setmediakeys-to-multiple-video-elements.js')
-rw-r--r--testing/web-platform/tests/encrypted-media/scripts/setmediakeys-to-multiple-video-elements.js54
1 files changed, 0 insertions, 54 deletions
diff --git a/testing/web-platform/tests/encrypted-media/scripts/setmediakeys-to-multiple-video-elements.js b/testing/web-platform/tests/encrypted-media/scripts/setmediakeys-to-multiple-video-elements.js
deleted file mode 100644
index d98f33f0c..000000000
--- a/testing/web-platform/tests/encrypted-media/scripts/setmediakeys-to-multiple-video-elements.js
+++ /dev/null
@@ -1,54 +0,0 @@
-function runTest(config, qualifier) {
- var testname = testnamePrefix(qualifier, config.keysystem)
- + ', setMediaKeys to multiple video elements';
-
- var configuration = getSimpleConfigurationForContent(config.content);
-
- if ( config.initDataType && config.initData ) {
- configuration.initDataTypes = [ config.initDataType ];
- }
-
- async_test (function (test) {
- var _video1 = config.video1,
- _video2 = config.video2,
- _mediaKeys;
-
- function onFailure(error) {
- forceTestFailureFromPromise(test, error);
- }
-
- navigator.requestMediaKeySystemAccess(config.keysystem, [configuration]).then(function(access) {
- assert_equals(access.keySystem, config.keysystem)
- return access.createMediaKeys();
- }).then(function(result) {
- _mediaKeys = result;
- assert_not_equals(_mediaKeys, null);
- assert_equals(typeof _mediaKeys.createSession, 'function');
- return _video1.setMediaKeys(_mediaKeys);
- }).then(function(result) {
- assert_not_equals(_video1.mediaKeys, null);
- assert_true(_video1.mediaKeys === _mediaKeys);
- // The specification allows this to fail, but it is not required to fail.
- return _video2.setMediaKeys(_mediaKeys);
- }).then(function(result) {
- // Second setMediaKeys is not required to fail.
- assert_true(_video2.mediaKeys === _mediaKeys);
- return Promise.resolve();
- }, function(error) {
- assert_equals(error.name, 'QuotaExceededError');
- assert_not_equals(error.message, '');
- // Return something so the promise resolves properly.
- return Promise.resolve();
- }).then(function() {
- // Now clear it from video1.
- return _video1.setMediaKeys(null);
- }).then(function() {
- // Should be assignable to video2.
- return _video2.setMediaKeys(_mediaKeys);
- }).then(function(result) {
- assert_not_equals(_video2.mediaKeys, null);
- assert_true(_video2.mediaKeys === _mediaKeys);
- test.done();
- }).catch(onFailure);
- }, testname);
-} \ No newline at end of file