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

Side by Side Diff: LayoutTests/crypto/resources/common.js

Issue 24641003: Implement Promise.all (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 7 years, 2 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
« no previous file with comments | « no previous file | LayoutTests/fast/canvas/canvas-createImageBitmap-drawImage.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 function importTestKeys() 1 function importTestKeys()
2 { 2 {
3 var keyFormat = "spki"; 3 var keyFormat = "spki";
4 var data = new Uint8Array([]); 4 var data = new Uint8Array([]);
5 var extractable = true; 5 var extractable = true;
6 var keyUsages = ['encrypt', 'decrypt', 'sign', 'verify']; 6 var keyUsages = ['encrypt', 'decrypt', 'sign', 'verify'];
7 7
8 var hmacPromise = crypto.subtle.importKey(keyFormat, data, {name: 'hmac', ha sh: {name: 'sha-1'}}, extractable, keyUsages); 8 var hmacPromise = crypto.subtle.importKey(keyFormat, data, {name: 'hmac', ha sh: {name: 'sha-1'}}, extractable, keyUsages);
9 var rsaSsaPromise = crypto.subtle.importKey(keyFormat, data, {name: 'RSASSA- PKCS1-v1_5', hash: {name: 'sha-1'}}, extractable, keyUsages); 9 var rsaSsaPromise = crypto.subtle.importKey(keyFormat, data, {name: 'RSASSA- PKCS1-v1_5', hash: {name: 'sha-1'}}, extractable, keyUsages);
10 var aesCbcPromise = crypto.subtle.importKey(keyFormat, data, {name: 'AES-CBC '}, extractable, keyUsages); 10 var aesCbcPromise = crypto.subtle.importKey(keyFormat, data, {name: 'AES-CBC '}, extractable, keyUsages);
11 var aesCbcJustDecrypt = crypto.subtle.importKey(keyFormat, data, {name: 'AES -CBC'}, false, ['decrypt']); 11 var aesCbcJustDecrypt = crypto.subtle.importKey(keyFormat, data, {name: 'AES -CBC'}, false, ['decrypt']);
12 12
13 return Promise.every(hmacPromise, rsaSsaPromise, aesCbcPromise, aesCbcJustDe crypt).then(function(results) { 13 return Promise.all([hmacPromise, rsaSsaPromise, aesCbcPromise, aesCbcJustDec rypt]).then(function(results) {
14 return { 14 return {
15 hmacSha1: results[0], 15 hmacSha1: results[0],
16 rsaSsaSha1: results[1], 16 rsaSsaSha1: results[1],
17 aesCbc: results[2], 17 aesCbc: results[2],
18 aesCbcJustDecrypt: results[3], 18 aesCbcJustDecrypt: results[3],
19 }; 19 };
20 }); 20 });
21 } 21 }
22 22
23 // Builds a hex string representation of any array-like input (array or 23 // Builds a hex string representation of any array-like input (array or
(...skipping 20 matching lines...) Expand all
44 chars.push(str.charCodeAt(i)); 44 chars.push(str.charCodeAt(i));
45 return new Uint8Array(chars); 45 return new Uint8Array(chars);
46 } 46 }
47 47
48 function failAndFinishJSTest(error) 48 function failAndFinishJSTest(error)
49 { 49 {
50 if (error) 50 if (error)
51 debug(error); 51 debug(error);
52 finishJSTest(); 52 finishJSTest();
53 } 53 }
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/canvas/canvas-createImageBitmap-drawImage.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698