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

Side by Side Diff: LayoutTests/media/encrypted-media/encrypted-media-async-creation-with-gc.html

Issue 1004843003: Use requestMediaKeySystemAccess() to check type support in EME layout tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Changes Created 5 years, 9 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 asynchronous creation of MediaKeys and MediaKeySession while running garbage collection</title> 4 <title>Test asynchronous creation of MediaKeys and MediaKeySession while running garbage collection</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 // Run garbage collection often. 14 // Run garbage collection often.
15 setInterval(asyncGC, 0); 15 setInterval(asyncGC, 0);
16 16
17 var initDataType;
18 var initData;
17 var mediaKeySession; 19 var mediaKeySession;
18 navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).t hen(function(access) { 20 getSupportedInitDataType().then(function(type) {
21 initDataType = type;
22 initData = getInitData(initDataType);
23 return navigator.requestMediaKeySystemAccess('org.w3.clearke y', [{}]);
24 }).then(function(access) {
19 return access.createMediaKeys(); 25 return access.createMediaKeys();
20 }).then(function(mediaKeys) { 26 }).then(function(mediaKeys) {
21 var initDataType = getInitDataType();
22 mediaKeySession = mediaKeys.createSession(); 27 mediaKeySession = mediaKeys.createSession();
23 return mediaKeySession.generateRequest(initDataType, getInit Data(initDataType)); 28 return mediaKeySession.generateRequest(initDataType, initDat a);
24 }).then(function() { 29 }).then(function() {
25 return mediaKeySession.close(); 30 return mediaKeySession.close();
26 }).then(function(result) { 31 }).then(function(result) {
27 test.done(); 32 test.done();
28 }).catch(function(error) { 33 }).catch(function(error) {
29 forceTestFailureFromPromise(test, error); 34 forceTestFailureFromPromise(test, error);
30 }); 35 });
31 }, 'Test asynchronous creation of MediaKeys and MediaKeySession whil e running garbage collection.'); 36 }, 'Test asynchronous creation of MediaKeys and MediaKeySession whil e running garbage collection.');
32 </script> 37 </script>
33 </body> 38 </body>
34 </html> 39 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698