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

Side by Side Diff: LayoutTests/crypto/aes-key-algorithm-mismatch.html

Issue 243853004: [webcrypto] Reject failed operations with a DOMException rather than null. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix compile warning Created 6 years, 7 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
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 12 matching lines...) Expand all
23 var algorithm = {name: 'aes-gcm'}; 23 var algorithm = {name: 'aes-gcm'};
24 24
25 return crypto.subtle.importKey('raw', keyData, algorithm, extractable, usage s); 25 return crypto.subtle.importKey('raw', keyData, algorithm, extractable, usage s);
26 }).then(function(result) { 26 }).then(function(result) {
27 key = result; 27 key = result;
28 shouldEvaluateAs("key.algorithm.name", "AES-GCM"); 28 shouldEvaluateAs("key.algorithm.name", "AES-GCM");
29 29
30 // Can't use an AES-KW key for AES-CBC (even though both are AES keys). 30 // Can't use an AES-KW key for AES-CBC (even though both are AES keys).
31 return crypto.subtle.encrypt({name: 'AES-CBC', iv: new Uint8Array(16)}, key, data); 31 return crypto.subtle.encrypt({name: 'AES-CBC', iv: new Uint8Array(16)}, key, data);
32 }).then(failAndFinishJSTest, function(result) { 32 }).then(failAndFinishJSTest, function(result) {
33 error = result; 33 logError(result);
34 shouldBeNull("error");
35 }).then(finishJSTest, failAndFinishJSTest); 34 }).then(finishJSTest, failAndFinishJSTest);
36 35
37 </script> 36 </script>
38 37
39 </body> 38 </body>
40 </html> 39 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698