Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / media / encrypted-media / encrypted-media-not-callable-after-createsession.html
blob3c6d4bb0ba7206252d21a1906b03a4720d456b82
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Test MediaKeySession not callable immediately after CreateSession().</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 <div id="log"></div>
11 <script>
12 // After creation, the MediaKeySession object is not
13 // callable, and we should get a InvalidStateError.
15 promise_test(function()
17 return navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).then(function(access) {
18 return access.createMediaKeys();
19 }).then(function(mediaKeys) {
20 var mediaKeySession = mediaKeys.createSession();
22 var arbitraryResponse = new Uint8Array([0x00, 0x11]);
23 return mediaKeySession.update(arbitraryResponse).then(function(result) {
24 assert_unreached('update() succeeded unexpectedly.');
25 }).catch(function(error) {
26 assert_equals(error.name, 'InvalidStateError');
27 });
28 });
29 }, 'Update() immediately after CreateSession().');
31 promise_test(function()
33 return navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).then(function(access) {
34 return access.createMediaKeys();
35 }).then(function(mediaKeys) {
36 var mediaKeySession = mediaKeys.createSession();
38 return mediaKeySession.close().then(function(result) {
39 assert_unreached('close() succeeded unexpectedly.');
40 }).catch(function(error) {
41 assert_equals(error.name, 'InvalidStateError');
42 });
43 });
44 }, 'Close() immediately after CreateSession().');
46 promise_test(function()
48 return navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).then(function(access) {
49 return access.createMediaKeys();
50 }).then(function(mediaKeys) {
51 var mediaKeySession = mediaKeys.createSession();
53 return mediaKeySession.remove().then(function(result) {
54 assert_unreached('remove() succeeded unexpectedly.');
55 }).catch(function(error) {
56 assert_equals(error.name, 'InvalidStateError');
57 });
58 });
59 }, 'Remove() immediately after CreateSession().');
60 </script>
61 </body>
62 </html>