OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <title>Prefixed and unprefixed EME API</title> | |
5 <script src="encrypted-media-utils.js"></script> | |
6 <script src="../../resources/testharness.js"></script> | |
7 <script src="../../resources/testharnessreport.js"></script> | |
8 </head> | |
9 <body> | |
10 <video id="testVideo"></video> | |
11 <div id="log"></div> | |
12 <script> | |
13 async_test(function(test) | |
14 { | |
15 var video = document.getElementById('testVideo'); | |
16 assert_not_equals(video, null); | |
17 | |
18 function loadStarted() | |
19 { | |
20 video.webkitGenerateKeyRequest('webkit-org.w3.clearkey'); | |
21 navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}
]).then(function(access) { | |
22 assert_equals(access.keySystem, 'org.w3.clearkey'); | |
23 return access.createMediaKeys(); | |
24 }).then(function(mediaKeys) { | |
25 assert_not_equals(mediaKeys, null); | |
26 assert_equals(typeof mediaKeys.createSession, 'function'
); | |
27 video.setMediaKeys(mediaKeys).then(function(result) { | |
28 assert_unreached('setMediaKeys should have failed.')
; | |
29 }, function(error) { | |
30 assert_equals(error.name, 'InvalidStateError'); | |
31 assert_not_equals(error.message, ''); | |
32 test.done(); | |
33 }); | |
34 }).catch(function(error) { | |
35 forceTestFailureFromPromise(test, error); | |
36 }); | |
37 } | |
38 | |
39 video.src = '../content/test-encrypted.webm'; | |
40 waitForEventAndRunStep('loadstart', video, loadStarted, test); | |
41 }, 'Call unprefixed EME API after prefixed EME API.'); | |
42 </script> | |
43 </body> | |
44 </html> | |
OLD | NEW |