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

Side by Side Diff: LayoutTests/crypto/encrypt-decrypt.html

Issue 104653004: [webcrypto] order Key.usages alphabetically. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/crypto/encrypt-decrypt-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 // (1) Import the key 82 // (1) Import the key
83 return crypto.subtle.importKey('raw', keyData, algorithm, extractable, usage s).then(function(result) { 83 return crypto.subtle.importKey('raw', keyData, algorithm, extractable, usage s).then(function(result) {
84 key = result; 84 key = result;
85 85
86 // shouldBe() can only resolve variables in global context. 86 // shouldBe() can only resolve variables in global context.
87 tmpKey = key; 87 tmpKey = key;
88 shouldBe("tmpKey.type", "'secret'") 88 shouldBe("tmpKey.type", "'secret'")
89 shouldBe("tmpKey.extractable", "false") 89 shouldBe("tmpKey.extractable", "false")
90 shouldBe("tmpKey.algorithm.name", "'AES-CBC'") 90 shouldBe("tmpKey.algorithm.name", "'AES-CBC'")
91 shouldBe("tmpKey.usages.join(',')", "'encrypt,decrypt'") 91 shouldBe("tmpKey.usages.join(',')", "'decrypt,encrypt'")
92 92
93 // (2) Encrypt. 93 // (2) Encrypt.
94 return crypto.subtle.encrypt(algorithm, key, hexStringToUint8Array(testC ase.plainText)); 94 return crypto.subtle.encrypt(algorithm, key, hexStringToUint8Array(testC ase.plainText));
95 }).then(function(result) { 95 }).then(function(result) {
96 bytesShouldMatchHexString("Encryption", testCase.cipherText, result); 96 bytesShouldMatchHexString("Encryption", testCase.cipherText, result);
97 97
98 // (3) Decrypt 98 // (3) Decrypt
99 return crypto.subtle.decrypt(algorithm, key, hexStringToUint8Array(testC ase.cipherText)); 99 return crypto.subtle.decrypt(algorithm, key, hexStringToUint8Array(testC ase.cipherText));
100 }).then(function(result) { 100 }).then(function(result) {
101 bytesShouldMatchHexString("Decryption", testCase.plainText, result); 101 bytesShouldMatchHexString("Decryption", testCase.plainText, result);
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 236
237 // ------------------------------------------------- 237 // -------------------------------------------------
238 // Wait until all the tests have been run. 238 // Wait until all the tests have been run.
239 // ------------------------------------------------- 239 // -------------------------------------------------
240 240
241 Promise.all(allTests).then(finishJSTest, failAndFinishJSTest); 241 Promise.all(allTests).then(finishJSTest, failAndFinishJSTest);
242 242
243 </script> 243 </script>
244 244
245 </body> 245 </body>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/crypto/encrypt-decrypt-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698