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

Side by Side Diff: third_party/WebKit/LayoutTests/crypto/subtle/importKey-badParameters.html

Issue 2707243006: [SharedArrayBuffer] Prevent SharedArrayBuffer being used in Web APIs (Closed)
Patch Set: update comment, add TODO Created 3 years, 8 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 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 <script src="resources/common.js"></script> 5 <script src="resources/common.js"></script>
6 </head> 6 </head>
7 <body> 7 <body>
8 <p id="description"></p> 8 <p id="description"></p>
9 <div id="console"></div> 9 <div id="console"></div>
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 // Missing hash parameter for HMAC. 56 // Missing hash parameter for HMAC.
57 return crypto.subtle.importKey('raw', new Uint8Array(20), {name: 'hmac'}, ex tractable, ['sign']); 57 return crypto.subtle.importKey('raw', new Uint8Array(20), {name: 'hmac'}, ex tractable, ['sign']);
58 }).then(failAndFinishJSTest, function(result) { 58 }).then(failAndFinishJSTest, function(result) {
59 logError(result); 59 logError(result);
60 60
61 // SHA-1 doesn't support the importKey operation. 61 // SHA-1 doesn't support the importKey operation.
62 return crypto.subtle.importKey('raw', new Uint8Array(20), {name: 'sha-1'}, e xtractable, ['sign']); 62 return crypto.subtle.importKey('raw', new Uint8Array(20), {name: 'sha-1'}, e xtractable, ['sign']);
63 }).then(failAndFinishJSTest, function(result) { 63 }).then(failAndFinishJSTest, function(result) {
64 logError(result); 64 logError(result);
65
66 // SharedArrayBuffer-backed view is not allowed.
67 if (window.SharedArrayBuffer) {
68 var bytes = new Uint8Array(new SharedArrayBuffer(16));
69 return crypto.subtle.importKey('raw', bytes, aesCbc, extractable, ['encr ypt']);
70 } else {
71 return Promise.reject('SharedArrayBuffers not enabled.');
72 }
73 }).then(failAndFinishJSTest, function(result) {
74 logError(result);
65 }).then(finishJSTest, failAndFinishJSTest); 75 }).then(finishJSTest, failAndFinishJSTest);
66 76
67 </script> 77 </script>
68 78
69 </body> 79 </body>
70 </html> 80 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698