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

Side by Side Diff: LayoutTests/crypto/clone-aesKey.html

Issue 770363002: [WebCrypto] Crypto tests updated to use KeyUsage (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Renamed file and removed unwanted expected file 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
« no previous file with comments | « no previous file | LayoutTests/crypto/clone-aesKey-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
11 <script> 11 <script>
12 description("Tests structured cloning of AES keys"); 12 description("Tests structured cloning of AES keys");
13 13
14 jsTestIsAsync = true; 14 jsTestIsAsync = true;
15 15
16 // Tests the 32 permutations of keys generated by: 16 // Tests the 32 permutations of keys generated by:
17 // kPossibleAlgorithms x kPossibleExtractable x kPossibleKeyUsages x kPossible KeyData 17 // kPossibleAlgorithms x kPossibleExtractable x kPossibleKeyUsages x kPossible KeyData
18 // 18 //
19 // For practical reasons these tests are not exhaustive. 19 // For practical reasons these tests are not exhaustive.
20 20
21 var k128BitData = "30112233445566778899aabbccddeeff" 21 var k128BitData = "30112233445566778899aabbccddeeff"
22 var k256BitData = "00112233445546778899aabbccddeeff000102030405060708090a0b0c0d0 e0f"; 22 var k256BitData = "00112233445546778899aabbccddeeff000102030405060708090a0b0c0d0 e0f";
23 23
24 var kPossibleAlgorithms = ['AES-CBC', 'AES-GCM']; 24 var kPossibleAlgorithms = ['AES-CBC', 'AES-GCM'];
25 var kPossibleExtractable = [true, false]; 25 var kPossibleExtractable = [true, false];
26 var kPossibleKeyUsages = [[], ['encrypt'], ['decrypt', 'wrapKey'], ['encrypt', ' wrapKey', 'unwrapKey']]; 26 var kPossibleKeyUsages = [['encrypt'], ['decrypt', 'wrapKey'], ['encrypt', 'wrap Key', 'unwrapKey']];
27 var kPossibleKeyData = [k128BitData, k256BitData]; 27 var kPossibleKeyData = [k128BitData, k256BitData];
28 28
29 function runTest(algorithmName, extractable, keyUsages, keyData) 29 function runTest(algorithmName, extractable, keyUsages, keyData)
30 { 30 {
31 var importData = hexStringToUint8Array(keyData); 31 var importData = hexStringToUint8Array(keyData);
32 var importAlgorithm = { name: algorithmName }; 32 var importAlgorithm = { name: algorithmName };
33 33
34 var results = {}; 34 var results = {};
35 35
36 return crypto.subtle.importKey('raw', importData, importAlgorithm, extractab le, keyUsages).then(function(importedKey) { 36 return crypto.subtle.importKey('raw', importData, importAlgorithm, extractab le, keyUsages).then(function(importedKey) {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 }); 82 });
83 }); 83 });
84 }); 84 });
85 85
86 lastPromise.then(finishJSTest, failAndFinishJSTest); 86 lastPromise.then(finishJSTest, failAndFinishJSTest);
87 87
88 </script> 88 </script>
89 89
90 </body> 90 </body>
91 </html> 91 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/crypto/clone-aesKey-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698