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

Side by Side Diff: LayoutTests/crypto/resources/subtle-crypto-concurrent.js

Issue 268653004: [refactor] Replace shouldBeTrue("a != b") with shouldNotBe("a", "b") in existing crypto tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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
« no previous file with comments | « LayoutTests/crypto/clone-rsaKey-public-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 if (self.importScripts) { 1 if (self.importScripts) {
2 importScripts('../../resources/js-test.js'); 2 importScripts('../../resources/js-test.js');
3 importScripts('common.js'); 3 importScripts('common.js');
4 } 4 }
5 5
6 function shouldEvaluateAsSilent(expressionToEval, expectedResult) 6 function shouldEvaluateAsSilent(expressionToEval, expectedResult)
7 { 7 {
8 var result = eval(expressionToEval); 8 var result = eval(expressionToEval);
9 if (result !== expectedResult) { 9 if (result !== expectedResult) {
10 testFailed(expressionToEval + " evaluated to " + result + " instead of " + expectedResult); 10 testFailed(expressionToEval + " evaluated to " + result + " instead of " + expectedResult);
(...skipping 15 matching lines...) Expand all
26 26
27 function notifyFailure(details) 27 function notifyFailure(details)
28 { 28 {
29 doPostMessage("FAIL:" + details); 29 doPostMessage("FAIL:" + details);
30 } 30 }
31 31
32 function testGenerateRsaKey() 32 function testGenerateRsaKey()
33 { 33 {
34 var extractable = false; 34 var extractable = false;
35 var usages = ['encrypt', 'decrypt']; 35 var usages = ['encrypt', 'decrypt'];
36 // Note that the modulus length is unsually small, in order to speed up the test. 36 // Note that the modulus length is unusually small in order to speed up
37 // the test (1024 or 2048 would be more typical).
37 var algorithm = {name: "RSAES-PKCS1-v1_5", modulusLength: 256, publicExponen t: hexStringToUint8Array("010001")}; 38 var algorithm = {name: "RSAES-PKCS1-v1_5", modulusLength: 256, publicExponen t: hexStringToUint8Array("010001")};
38 39
39 return crypto.subtle.generateKey(algorithm, extractable, usages).then(functi on(result) { 40 return crypto.subtle.generateKey(algorithm, extractable, usages).then(functi on(result) {
40 publicKey = result.publicKey; 41 publicKey = result.publicKey;
41 privateKey = result.privateKey; 42 privateKey = result.privateKey;
42 43
43 shouldEvaluateAsSilent("publicKey.type", "public"); 44 shouldEvaluateAsSilent("publicKey.type", "public");
44 shouldEvaluateAsSilent("publicKey.extractable", true); 45 shouldEvaluateAsSilent("publicKey.extractable", true);
45 shouldEvaluateAsSilent("publicKey.algorithm.name", algorithm.name); 46 shouldEvaluateAsSilent("publicKey.algorithm.name", algorithm.name);
46 shouldEvaluateAsSilent("publicKey.algorithm.modulusLength", algorithm.mo dulusLength); 47 shouldEvaluateAsSilent("publicKey.algorithm.modulusLength", algorithm.mo dulusLength);
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 }); 178 });
178 } 179 }
179 180
180 Promise.all([ 181 Promise.all([
181 testHmac(), 182 testHmac(),
182 testGenerateRsaKey(), 183 testGenerateRsaKey(),
183 testAesGcm(), 184 testAesGcm(),
184 testHmac(), 185 testHmac(),
185 testAesGcm(), 186 testAesGcm(),
186 ]).then(notifySuccess, notifyFailure); 187 ]).then(notifySuccess, notifyFailure);
OLDNEW
« no previous file with comments | « LayoutTests/crypto/clone-rsaKey-public-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698