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

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

Issue 243853004: [webcrypto] Reject failed operations with a DOMException rather than null. (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) 1 function logError(error)
2 { 2 {
3 var value = eval(toEval); 3 debug("error is: " + error.toString());
4 if (value instanceof TypeError) {
5 testPassed(toEval + " is: " + value.toString());
6 } else {
7 testFailed(toEval + " is not a TypeError: " + value);
8 }
9 } 4 }
10 5
11 // Verifies that the given "bytes" holds the same value as "expectedHexString". 6 // Verifies that the given "bytes" holds the same value as "expectedHexString".
12 // "bytes" can be anything recognized by "bytesToHexString()". 7 // "bytes" can be anything recognized by "bytesToHexString()".
13 function bytesShouldMatchHexString(testDescription, expectedHexString, bytes) 8 function bytesShouldMatchHexString(testDescription, expectedHexString, bytes)
14 { 9 {
15 expectedHexString = "[" + expectedHexString.toLowerCase() + "]"; 10 expectedHexString = "[" + expectedHexString.toLowerCase() + "]";
16 var actualHexString = "[" + bytesToHexString(bytes) + "]"; 11 var actualHexString = "[" + bytesToHexString(bytes) + "]";
17 12
18 if (actualHexString === expectedHexString) { 13 if (actualHexString === expectedHexString) {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 if (internals) 97 if (internals)
103 debug("Serialized key bytes: " + bytesToHexString(internals.serializeObj ect(o))); 98 debug("Serialized key bytes: " + bytesToHexString(internals.serializeObj ect(o)));
104 } 99 }
105 100
106 function shouldEvaluateAs(actual, expectedValue) 101 function shouldEvaluateAs(actual, expectedValue)
107 { 102 {
108 if (typeof expectedValue == "string") 103 if (typeof expectedValue == "string")
109 return shouldBeEqualToString(actual, expectedValue); 104 return shouldBeEqualToString(actual, expectedValue);
110 return shouldEvaluateTo(actual, expectedValue); 105 return shouldEvaluateTo(actual, expectedValue);
111 } 106 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698