Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / media / encrypted-media / encrypted-media-session-closed-event.html
blobe974ccfacae7cb76191138231d6ee78298fb0711
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Test MediaKeySession closed event</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 async_test(function(test)
14 var initDataType;
15 var initData;
16 var mediaKeySession;
17 getSupportedInitDataType().then(function(type) {
18 initDataType = type;
19 initData = getInitData(initDataType);
20 return navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]);
21 }).then(function(access) {
22 return access.createMediaKeys();
23 }).then(function(mediaKeys) {
24 mediaKeySession = mediaKeys.createSession();
25 return mediaKeySession.generateRequest(initDataType, initData);
26 }).then(function() {
27 // Wait for the session to be closed.
28 mediaKeySession.closed.then(function(result) {
29 assert_equals(result, undefined);
30 // Now that the session is closed, verify that the
31 // closed attribute immediately returns a fulfilled
32 // promise.
33 return mediaKeySession.closed;
34 }).then(function(result) {
35 assert_equals(result, undefined);
36 test.done();
37 });
39 // release() should result in the closed promise being
40 // fulfilled.
41 return mediaKeySession.close();
42 }).catch(function(error) {
43 forceTestFailureFromPromise(test, error);
44 });
45 }, 'Test MediaKeySession closed event.');
46 </script>
47 </body>
48 </html>