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

Side by Side Diff: LayoutTests/media/encrypted-media/encrypted-media-v2-events.html

Issue 16387015: Make unprefixed EME APIs use platform and Chromium. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: KURL.h moved Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/media/encrypted-media/encrypted-media-v2-events-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>MediaKeys</title> 4 <title>MediaKeys</title>
5 <script src=../video-test.js></script> 5 <script src=../video-test.js></script>
6 <script> 6 <script>
7 function stringToUint8Array(str) 7 function stringToUint8Array(str)
8 { 8 {
9 var arr=[]; 9 var arr=[];
10 for(var i=0,j=str.length;i<j;++i) 10 for(var i=0,j=str.length;i<j;++i)
11 arr[i]=str.charCodeAt(i); 11 arr[i]=str.charCodeAt(i);
12 return new Uint8Array(arr); 12 return new Uint8Array(arr);
13 } 13 }
14 14
15 var mediaKeys; 15 var mediaKeys;
16 var mediaKeySession; 16 var mediaKeySession;
17 var initData = stringToUint8Array('mock'); 17 var initData = stringToUint8Array('mock');
18 var invalidKey = stringToUint8Array('invalid'); 18 var invalidKey = stringToUint8Array('invalid');
19 var validKey = stringToUint8Array('key'); 19 var validKey = stringToUint8Array('1234567890abcdef');
20 20
21 function runTest() 21 function runTest()
22 { 22 {
23 // Initialize the MockCDM. It supports the key system 'com.apple .mock', the 23 run('mediaKeys = new MediaKeys("org.w3.clearkey")');
24 // mime type 'video/mock'. It requires init data to begin with ' mock', and 24 run('mediaKeySession = mediaKeys.createSession("video/webm", ini tData)');
25 // keys to begin with 'key'.
26 if (internals)
27 internals.initializeMockCDM();
28
29 run('mediaKeys = new MediaKeys("com.webcore.mock")');
30 run('mediaKeySession = mediaKeys.createSession("video/mock", ini tData)');
31 waitForEvent('webkitkeymessage', keyMessage, false, false, media KeySession); 25 waitForEvent('webkitkeymessage', keyMessage, false, false, media KeySession);
32 waitForEvent('webkitkeyerror', keyError, false, false, mediaKeyS ession); 26 waitForEvent('webkitkeyerror', keyError, false, false, mediaKeyS ession);
33 waitForEvent('webkitkeyadded', null, true, false, mediaKeySessio n); 27 waitForEvent('webkitkeyadded', null, true, false, mediaKeySessio n);
34 } 28 }
35 29
36 function keyMessage(event) 30 function keyMessage(event)
37 { 31 {
38 run('mediaKeySession.update(invalidKey)'); 32 run('mediaKeySession.update(invalidKey)');
39 } 33 }
40 34
41 function keyError(event) 35 function keyError(event)
42 { 36 {
43 run('mediaKeySession.update(validKey)'); 37 run('mediaKeySession.update(validKey)');
44 } 38 }
45 </script> 39 </script>
46 </head> 40 </head>
47 <body onload="runTest()"> 41 <body onload="runTest()">
48 <p>This tests the events created by MediaKeys.</p> 42 <p>This tests the events created by MediaKeys.</p>
49 </body> 43 </body>
50 </html> 44 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/media/encrypted-media/encrypted-media-v2-events-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698