Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-session-closed-event.html

Issue 2084053002: EME: Update tests so 'audioCapabilities' always provided (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changes (+rebase) Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Test MediaKeySession closed event</title> 4 <title>Test MediaKeySession closed event</title>
5 <script src="encrypted-media-utils.js"></script> 5 <script src="encrypted-media-utils.js"></script>
6 <script src="../../resources/testharness.js"></script> 6 <script src="../../resources/testharness.js"></script>
7 <script src="../../resources/testharnessreport.js"></script> 7 <script src="../../resources/testharnessreport.js"></script>
8 </head> 8 </head>
9 <body> 9 <body>
10 <div id="log"></div> 10 <div id="log"></div>
11 <script> 11 <script>
12 async_test(function(test) 12 async_test(function(test)
13 { 13 {
14 var initDataType; 14 var initDataType;
15 var initData; 15 var initData;
16 var mediaKeySession; 16 var mediaKeySession;
17 getSupportedInitDataType().then(function(type) { 17
18 initDataType = type; 18 navigator.requestMediaKeySystemAccess('org.w3.clearkey', getSimp leConfiguration()).then(function(access) {
19 initDataType = access.getConfiguration().initDataTypes[0];
19 initData = getInitData(initDataType); 20 initData = getInitData(initDataType);
20 return navigator.requestMediaKeySystemAccess('org.w3.clearke y', [{}]);
21 }).then(function(access) {
22 return access.createMediaKeys(); 21 return access.createMediaKeys();
23 }).then(function(mediaKeys) { 22 }).then(function(mediaKeys) {
24 mediaKeySession = mediaKeys.createSession(); 23 mediaKeySession = mediaKeys.createSession();
25 return mediaKeySession.generateRequest(initDataType, initDat a); 24 return mediaKeySession.generateRequest(initDataType, initDat a);
26 }).then(function() { 25 }).then(function() {
27 // Wait for the session to be closed. 26 // Wait for the session to be closed.
28 mediaKeySession.closed.then(function(result) { 27 mediaKeySession.closed.then(function(result) {
29 assert_equals(result, undefined); 28 assert_equals(result, undefined);
30 // Now that the session is closed, verify that the 29 // Now that the session is closed, verify that the
31 // closed attribute immediately returns a fulfilled 30 // closed attribute immediately returns a fulfilled
32 // promise. 31 // promise.
33 return mediaKeySession.closed; 32 return mediaKeySession.closed;
34 }).then(function(result) { 33 }).then(function(result) {
35 assert_equals(result, undefined); 34 assert_equals(result, undefined);
36 test.done(); 35 test.done();
37 }); 36 });
38 37
39 // release() should result in the closed promise being 38 // release() should result in the closed promise being
40 // fulfilled. 39 // fulfilled.
41 return mediaKeySession.close(); 40 return mediaKeySession.close();
42 }).catch(function(error) { 41 }).catch(function(error) {
43 forceTestFailureFromPromise(test, error); 42 forceTestFailureFromPromise(test, error);
44 }); 43 });
45 }, 'Test MediaKeySession closed event.'); 44 }, 'Test MediaKeySession closed event.');
46 </script> 45 </script>
47 </body> 46 </body>
48 </html> 47 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698