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

Side by Side Diff: LayoutTests/media/encrypted-media/encrypted-media-playback-multiple-sessions.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>Clear Key Playback with Multiple Sessions</title> 4 <title>Clear Key Playback with Multiple Sessions</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 <video id="testVideo"></video> 10 <video id="testVideo"></video>
(...skipping 12 matching lines...) Expand all
23 var audioKeyId = '1234567890123456'; 23 var audioKeyId = '1234567890123456';
24 var audioKey = new Uint8Array([0x30, 0x30, 0x62, 0xF1, 0x68, 0x1 4, 0xD2, 0x7B, 24 var audioKey = new Uint8Array([0x30, 0x30, 0x62, 0xF1, 0x68, 0x1 4, 0xD2, 0x7B,
25 0x68, 0xEF, 0x12, 0x2A, 0xFC, 0xE 4, 0xAE, 0x0A]); 25 0x68, 0xEF, 0x12, 0x2A, 0xFC, 0xE 4, 0xAE, 0x0A]);
26 var videoKeyId = '0123456789012345'; 26 var videoKeyId = '0123456789012345';
27 var videoKey = new Uint8Array([0x7A, 0x7A, 0x62, 0xF1, 0x68, 0x1 4, 0xD2, 0x7B, 27 var videoKey = new Uint8Array([0x7A, 0x7A, 0x62, 0xF1, 0x68, 0x1 4, 0xD2, 0x7B,
28 0x68, 0xEF, 0x12, 0x2A, 0xFC, 0xE 4, 0xAE, 0x0A]); 28 0x68, 0xEF, 0x12, 0x2A, 0xFC, 0xE 4, 0xAE, 0x0A]);
29 29
30 function onNeedKey(event) 30 function onNeedKey(event)
31 { 31 {
32 var keyId = String.fromCharCode.apply(null, event.initData); 32 var keyId = String.fromCharCode.apply(null, event.initData);
33 video.mediaKeys.createSession(event.contentType, event.initD ata).then(function(newSession) { 33
34 var mediaKeySession = video.mediaKeys.createSession();
35 waitForEventAndRunStep('message', mediaKeySession, onMessage , test);
36 mediaKeySession.generateRequest(event.contentType, event.ini tData).then(function() {
34 if (keyId == videoKeyId) { 37 if (keyId == videoKeyId) {
35 assert_equals(videoMediaKeySession, null); 38 assert_equals(videoMediaKeySession, null);
36 videoMediaKeySession = newSession; 39 videoMediaKeySession = mediaKeySession;
37 } else { 40 } else {
38 assert_equals(keyId, audioKeyId); 41 assert_equals(keyId, audioKeyId);
39 assert_equals(audioMediaKeySession, null); 42 assert_equals(audioMediaKeySession, null);
40 audioMediaKeySession = newSession; 43 audioMediaKeySession = mediaKeySession;
41 } 44 }
42 waitForEventAndRunStep('message', newSession, onMessage, test);
43 }).catch(function(error) { 45 }).catch(function(error) {
44 forceTestFailureFromPromise(test, error); 46 forceTestFailureFromPromise(test, error);
45 }); 47 });
46 } 48 }
47 49
48 function onMessage(event) 50 function onMessage(event)
49 { 51 {
50 var keyId = extractSingleKeyIdFromMessage(event.message); 52 var keyId = extractSingleKeyIdFromMessage(event.message);
51 if (event.target == videoMediaKeySession) { 53 if (event.target == videoMediaKeySession) {
52 assert_equals(String.fromCharCode.apply(null, keyId), vi deoKeyId); 54 assert_equals(String.fromCharCode.apply(null, keyId), vi deoKeyId);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 video.setMediaKeys(mediaKeys); 98 video.setMediaKeys(mediaKeys);
97 video.src = '../content/test-encrypted-different-av-keys.web m'; 99 video.src = '../content/test-encrypted-different-av-keys.web m';
98 video.play(); 100 video.play();
99 }).catch(function(error) { 101 }).catch(function(error) {
100 forceTestFailureFromPromise(test, error); 102 forceTestFailureFromPromise(test, error);
101 }); 103 });
102 }, 'Playback using Clear Key key system with multiple sessions.'); 104 }, 'Playback using Clear Key key system with multiple sessions.');
103 </script> 105 </script>
104 </body> 106 </body>
105 </html> 107 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698