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

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

Issue 240063002: [webcrypto] Update layout tests to match idl generator changes. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 function shouldBeTypeError(toEval)
2 {
3 var value = eval(toEval);
4 if (value instanceof TypeError) {
5 testPassed(toEval + " is: " + value.toString());
6 } else {
7 testFailed(toEval + " is not a TypeError: " + value);
8 }
9 }
10
1 // Verifies that the given "bytes" holds the same value as "expectedHexString". 11 // Verifies that the given "bytes" holds the same value as "expectedHexString".
2 // "bytes" can be anything recognized by "bytesToHexString()". 12 // "bytes" can be anything recognized by "bytesToHexString()".
3 function bytesShouldMatchHexString(testDescription, expectedHexString, bytes) 13 function bytesShouldMatchHexString(testDescription, expectedHexString, bytes)
4 { 14 {
5 expectedHexString = "[" + expectedHexString.toLowerCase() + "]"; 15 expectedHexString = "[" + expectedHexString.toLowerCase() + "]";
6 var actualHexString = "[" + bytesToHexString(bytes) + "]"; 16 var actualHexString = "[" + bytesToHexString(bytes) + "]";
7 17
8 if (actualHexString === expectedHexString) { 18 if (actualHexString === expectedHexString) {
9 debug("PASS: " + testDescription + " should be " + expectedHexString + " and was"); 19 debug("PASS: " + testDescription + " should be " + expectedHexString + " and was");
10 } else { 20 } else {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 if (internals) 102 if (internals)
93 debug("Serialized key bytes: " + bytesToHexString(internals.serializeObj ect(o))); 103 debug("Serialized key bytes: " + bytesToHexString(internals.serializeObj ect(o)));
94 } 104 }
95 105
96 function shouldEvaluateAs(actual, expectedValue) 106 function shouldEvaluateAs(actual, expectedValue)
97 { 107 {
98 if (typeof expectedValue == "string") 108 if (typeof expectedValue == "string")
99 return shouldBeEqualToString(actual, expectedValue); 109 return shouldBeEqualToString(actual, expectedValue);
100 return shouldEvaluateTo(actual, expectedValue); 110 return shouldEvaluateTo(actual, expectedValue);
101 } 111 }
OLDNEW
« no previous file with comments | « LayoutTests/crypto/digest-failures-expected.txt ('k') | LayoutTests/crypto/unwrapKey-badParameters.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698