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

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: Fix compile warning 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
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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 debug("Serialized key bytes: " + bytesToHexString(serializedWithoutVersi on)); 101 debug("Serialized key bytes: " + bytesToHexString(serializedWithoutVersi on));
107 } 102 }
108 } 103 }
109 104
110 function shouldEvaluateAs(actual, expectedValue) 105 function shouldEvaluateAs(actual, expectedValue)
111 { 106 {
112 if (typeof expectedValue == "string") 107 if (typeof expectedValue == "string")
113 return shouldBeEqualToString(actual, expectedValue); 108 return shouldBeEqualToString(actual, expectedValue);
114 return shouldEvaluateTo(actual, expectedValue); 109 return shouldEvaluateTo(actual, expectedValue);
115 } 110 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698