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 navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}
]).then(function(access) { | |
21 assert_equals(access.keySystem, 'org.w3.clearkey'); | |
22 return access.createMediaKeys(); | |
23 }).then(function(mediaKeys) { | |
24 assert_not_equals(mediaKeys, null); | |
25 return video.setMediaKeys(mediaKeys); | |
26 }).then(function(result) { | |
27 assert_throws('InvalidStateError', | |
28 function () { video.webkitGenerateKeyReque
st('webkit-org.w3.clearkey'); }); | |
29 test.done(); | |
30 }).catch(function(error) { | |
31 forceTestFailureFromPromise(test, error); | |
32 }); | |
33 } | |
34 | |
35 video.src = '../content/test-encrypted.webm'; | |
36 waitForEventAndRunStep('loadstart', video, loadStarted, test); | |
37 }, 'Call prefixed EME API after unprefixed EME API.'); | |
38 </script> | |
39 </body> | |
40 </html> | |
OLD | NEW |