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

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

Issue 141413003: [webcrypto] Match the error handling defined by the spec. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 11 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
11 <script> 11 <script>
12 description("Tests cypto.subtle.exportKey."); 12 description("Tests cypto.subtle.exportKey.");
13 13
14 jsTestIsAsync = true; 14 jsTestIsAsync = true;
15 15
16 importTestKeys().then(function(result) { 16 addTask(importTestKeys().then(function(result) {
17 keys = result; 17 keys = result;
18 18
19 // Invalid export formats. 19 // Invalid export formats.
20 shouldThrow("crypto.subtle.exportKey(3, keys.aesCbcJustDecrypt)"); 20 shouldThrow("crypto.subtle.exportKey(3, keys.aesCbcJustDecrypt)");
21 shouldThrow("crypto.subtle.exportKey(null, keys.aesCbcJustDecrypt)"); 21 shouldThrow("crypto.subtle.exportKey(null, keys.aesCbcJustDecrypt)");
22 shouldThrow("crypto.subtle.exportKey('invalid', keys.aesCbcJustDecrypt)"); 22 shouldThrow("crypto.subtle.exportKey('invalid', keys.aesCbcJustDecrypt)");
23 23
24 // Invalid keys 24 // Invalid keys
25 shouldThrow("crypto.subtle.exportKey('raw', null)"); 25 shouldThrow("crypto.subtle.exportKey('raw', null)");
26 shouldThrow("crypto.subtle.exportKey('raw', 3)"); 26 shouldThrow("crypto.subtle.exportKey('raw', 3)");
27 27
28 shouldBe("keys.aesCbcJustDecrypt.extractable", "false") 28 shouldBe("keys.aesCbcJustDecrypt.extractable", "false")
29 shouldThrow("crypto.subtle.exportKey('raw', keys.aesCbcJustDecrypt)"); 29 shouldRejectPromiseWithNull("crypto.subtle.exportKey('raw', keys.aesCbcJustD ecrypt)");
30 30
31 // TODO(eroman): exportKey() is not implemented. 31 // TODO(eroman): exportKey() is not implemented.
32 }).then(finishJSTest, failAndFinishJSTest); 32 }));
33
34 completeTestWhenAllTasksDone();
33 35
34 </script> 36 </script>
35 37
36 </body> 38 </body>
37 </html> 39 </html>
OLDNEW
« no previous file with comments | « LayoutTests/crypto/encrypt-decrypt-expected.txt ('k') | LayoutTests/crypto/exportKey-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698