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>
10 <video id="testVideo"></video>
12 <p>Call prefixed EME API after unprefixed EME API.</p>
14 async_test(function(test)
16 var video = document.getElementById('testVideo');
17 assert_not_equals(video, null);
19 function loadStarted()
21 MediaKeys.create('org.w3.clearkey').then(function(mediaKeys) {
22 assert_not_equals(mediaKeys, null);
23 assert_equals(mediaKeys.keySystem, 'org.w3.clearkey');
24 return video.setMediaKeys(mediaKeys);
25 }).then(function(result) {
26 assert_throws('InvalidStateError',
27 function () { video.webkitGenerateKeyRequest('webkit-org.w3.clearkey'); });
29 }).catch(function(error) {
30 forceTestFailureFromPromise(test, error);
34 video.src = '../content/test-encrypted.webm';
35 waitForEventAndRunStep('loadstart', video, loadStarted, test);
36 }, 'Call prefixed EME API after unprefixed EME API.');