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

Side by Side Diff: LayoutTests/media/encrypted-media/encrypted-media-lifetime-multiple-mediakeys.html

Issue 543173002: Implement MediaKeySession.generateRequest() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 3 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 multiple MediaKeys lifetimes</title> 4 <title>Test multiple MediaKeys lifetimes</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>
(...skipping 28 matching lines...) Expand all
39 } 39 }
40 40
41 // Create a MediaKeys object and an associated MediaKeySession 41 // Create a MediaKeys object and an associated MediaKeySession
42 // object. |mediaKeys| is updated to refer to the new MediaKeys 42 // object. |mediaKeys| is updated to refer to the new MediaKeys
43 // object. Returns a promise that resolves with the new 43 // object. Returns a promise that resolves with the new
44 // MediaKeySession object. 44 // MediaKeySession object.
45 function createMediaKeyWithMediaKeySession() 45 function createMediaKeyWithMediaKeySession()
46 { 46 {
47 return MediaKeys.create('org.w3.clearkey').then(function(res ult) { 47 return MediaKeys.create('org.w3.clearkey').then(function(res ult) {
48 mediaKeys = result; 48 mediaKeys = result;
49 return mediaKeys.createSession(initDataType, initData); 49 var mediaKeySession = mediaKeys.createSession();
50 return mediaKeySession.generateRequest(initDataType, ini tData).then(function() {
51 return mediaKeySession;
52 });
50 }); 53 });
51 } 54 }
52 55
53 // Create a few MediaKeys + MediaKeySession objects. Only keep 56 // Create a few MediaKeys + MediaKeySession objects. Only keep
54 // a reference to the last one created. 57 // a reference to the last one created.
55 createMediaKeyWithMediaKeySession().then(function(mediaKeySessio n) { 58 createMediaKeyWithMediaKeySession().then(function(mediaKeySessio n) {
56 // Should be 1 MediaKeySession. 59 // Should be 1 MediaKeySession.
57 assert_equals(numActiveDOMObjectsCreated(), 1); 60 assert_equals(numActiveDOMObjectsCreated(), 1);
58 return createMediaKeyWithMediaKeySession(); 61 return createMediaKeyWithMediaKeySession();
59 }).then(function(mediaKeySession) { 62 }).then(function(mediaKeySession) {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 }).then(function(result) { 120 }).then(function(result) {
118 assert_equals(numActiveDOMObjectsCreated(), 0); 121 assert_equals(numActiveDOMObjectsCreated(), 0);
119 test.done(); 122 test.done();
120 }).catch(function(error) { 123 }).catch(function(error) {
121 forceTestFailureFromPromise(test, error); 124 forceTestFailureFromPromise(test, error);
122 }); 125 });
123 }, 'Multiple MediaKeys lifetime'); 126 }, 'Multiple MediaKeys lifetime');
124 </script> 127 </script>
125 </body> 128 </body>
126 </html> 129 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698