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

Side by Side Diff: LayoutTests/crypto/exportKey-badParameters.html

Issue 806913006: [WebCrypto] Move LayoutTests from crypto to crypto/subtle (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update path for deserialize legacy tests Created 6 years 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
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../resources/js-test.js"></script>
5 <script src="resources/common.js"></script>
6 </head>
7 <body>
8 <p id="description"></p>
9 <div id="console"></div>
10
11 <script>
12 description("Tests exportKey() given bad inputs.");
13
14 jsTestIsAsync = true;
15
16 function importAesKey()
17 {
18 var keyData = new Uint8Array(16);
19 var usages = ['encrypt'];
20 var extractable = true;
21 var algorithm = {name: 'aes-cbc'};
22
23 return crypto.subtle.importKey('raw', keyData, algorithm, extractable, usage s);
24 }
25
26 Promise.resolve(null).then(function(result) {
27 // null is not a valid Key.
28 return crypto.subtle.exportKey('raw', null);
29 }).then(failAndFinishJSTest, function(result) {
30 logError(result);
31
32 // 3 is not a valid Key.
33 return crypto.subtle.exportKey('raw', 3);
34 }).then(failAndFinishJSTest, function(result) {
35 logError(result);
36
37 return importAesKey();
38 }).then(function(result) {
39 key = result;
40
41 // Invalid export format
42 return crypto.subtle.exportKey(3, key);
43 }).then(failAndFinishJSTest, function(result) {
44 logError(result);
45
46 // Invalid export format
47 return crypto.subtle.exportKey(null, key);
48 }).then(failAndFinishJSTest, function(result) {
49 logError(result);
50
51 // Invalid export format
52 return crypto.subtle.exportKey('invalid', key);
53 }).then(failAndFinishJSTest, function(result) {
54 logError(result);
55 }).then(finishJSTest, failAndFinishJSTest);
56
57 </script>
58
59 </body>
60 </html>
OLDNEW
« no previous file with comments | « LayoutTests/crypto/ecdsa-sign-verify-expected.txt ('k') | LayoutTests/crypto/exportKey-badParameters-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698