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

Side by Side Diff: third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-generate-request-disallowed-input.html

Issue 2228213002: EME: Specify the correct size for PSSH boxes in tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 handling of invalid initData for generateRequest().</title> 4 <title>Test handling of invalid initData for generateRequest().</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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 var initData = new Uint8Array([ 59 var initData = new Uint8Array([
60 0x00, 0x00, 0xff, 0xff, // size = h uge 60 0x00, 0x00, 0xff, 0xff, // size = h uge
61 0x70, 0x73, 0x73, 0x68, // 'pssh' 61 0x70, 0x73, 0x73, 0x68, // 'pssh'
62 0x00, // version = 0 62 0x00, // version = 0
63 0x00, 0x00, 0x00, // flags 63 0x00, 0x00, 0x00, // flags
64 0x10, 0x77, 0xEF, 0xEC, 0xC0, 0xB2, 0x4D, 0x02, // Common S ystemID 64 0x10, 0x77, 0xEF, 0xEC, 0xC0, 0xB2, 0x4D, 0x02, // Common S ystemID
65 0xAC, 0xE3, 0x3C, 0x1E, 0x52, 0xE2, 0xFB, 0x4B, 65 0xAC, 0xE3, 0x3C, 0x1E, 0x52, 0xE2, 0xFB, 0x4B,
66 0x00, 0x00, 0x00, 0x00 // datasize 66 0x00, 0x00, 0x00, 0x00 // datasize
67 ]); 67 ]);
68 return test_session('cenc', initData); 68 return test_session('cenc', initData);
69 }, 'generateRequest() with invalid pssh data.'); 69 }, 'generateRequest() with invalid pssh box size.');
70 70
71 promise_test(function() 71 promise_test(function()
72 { 72 {
73 // Invalid data as type = 'psss'. 73 // Invalid data as type = 'psss'.
74 var initData = new Uint8Array([ 74 var initData = new Uint8Array([
75 0x00, 0x00, 0x00, 0x00, // size = 0 75 0x00, 0x00, 0x00, 0x20, // size = 0
ddorwin 2016/08/11 00:16:18 The comment was not updated. This is fixed in http
76 0x70, 0x73, 0x73, 0x73, // 'psss' 76 0x70, 0x73, 0x73, 0x73, // 'psss'
77 0x00, // version = 0 77 0x00, // version = 0
78 0x00, 0x00, 0x00, // flags 78 0x00, 0x00, 0x00, // flags
79 0x10, 0x77, 0xEF, 0xEC, 0xC0, 0xB2, 0x4D, 0x02, // Common S ystemID 79 0x10, 0x77, 0xEF, 0xEC, 0xC0, 0xB2, 0x4D, 0x02, // Common S ystemID
80 0xAC, 0xE3, 0x3C, 0x1E, 0x52, 0xE2, 0xFB, 0x4B, 80 0xAC, 0xE3, 0x3C, 0x1E, 0x52, 0xE2, 0xFB, 0x4B,
81 0x00, 0x00, 0x00, 0x00 // datasize 81 0x00, 0x00, 0x00, 0x00 // datasize
82 ]); 82 ]);
83 return test_session('cenc', initData); 83 return test_session('cenc', initData);
84 }, 'generateRequest() with non pssh data.'); 84 }, 'generateRequest() with non pssh data.');
85 85
86 promise_test(function() 86 promise_test(function()
87 { 87 {
88 // Valid key ID size must be at least 1 character for keyids. 88 // Valid key ID size must be at least 1 character for keyids.
89 var keyId = new Uint8Array(0); 89 var keyId = new Uint8Array(0);
90 var initData = stringToUint8Array(createKeyIDs(keyId)); 90 var initData = stringToUint8Array(createKeyIDs(keyId));
91 return test_session('keyids', initData); 91 return test_session('keyids', initData);
92 }, 'generateRequest() with too short key ID.'); 92 }, 'generateRequest() with too short key ID.');
93 93
94 promise_test(function() 94 promise_test(function()
95 { 95 {
96 // Valid key ID size must be less than 512 characters for keyids . 96 // Valid key ID size must be less than 512 characters for keyids .
97 var keyId = new Uint8Array(600); 97 var keyId = new Uint8Array(600);
98 var initData = stringToUint8Array(createKeyIDs(keyId)); 98 var initData = stringToUint8Array(createKeyIDs(keyId));
99 return test_session('keyids', initData); 99 return test_session('keyids', initData);
100 }, 'generateRequest() with too long key ID.'); 100 }, 'generateRequest() with too long key ID.');
101 </script> 101 </script>
102 </body> 102 </body>
103 </html> 103 </html>
OLDNEW
« no previous file with comments | « media/cdm/cenc_utils_unittest.cc ('k') | third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-utils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698