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

Side by Side Diff: third_party/WebKit/LayoutTests/crypto/subtle/resources/common.js

Issue 2712783002: V8ScriptValueSerializer: Add a separate version 'envelope' for Blink format version. (Closed)
Patch Set: Merge branch 'master' into ssv-separate-version Created 3 years, 9 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
OLDNEW
1 function logError(error) 1 function logError(error)
2 { 2 {
3 debug("error is: " + error.toString()); 3 debug("error is: " + error.toString());
4 } 4 }
5 5
6 // Verifies that the given "bytes" holds the same value as "expectedHexString". 6 // Verifies that the given "bytes" holds the same value as "expectedHexString".
7 // "bytes" can be anything recognized by "bytesToHexString()". 7 // "bytes" can be anything recognized by "bytesToHexString()".
8 function bytesShouldMatchHexString(testDescription, expectedHexString, bytes) 8 function bytesShouldMatchHexString(testDescription, expectedHexString, bytes)
9 { 9 {
10 expectedHexString = "[" + expectedHexString.toLowerCase() + "]"; 10 expectedHexString = "[" + expectedHexString.toLowerCase() + "]";
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 self.channel.port2.postMessage(key); 106 self.channel.port2.postMessage(key);
107 }); 107 });
108 } 108 }
109 109
110 // Logging the serialized format ensures that if it changes it will break tests. 110 // Logging the serialized format ensures that if it changes it will break tests.
111 function logSerializedKey(o) 111 function logSerializedKey(o)
112 { 112 {
113 if (internals) { 113 if (internals) {
114 // Removing the version tag from the output so serialization format chan ges don't need to update all the crypto tests. 114 // Removing the version tag from the output so serialization format chan ges don't need to update all the crypto tests.
115 var serialized = internals.serializeObject(o); 115 var serialized = internals.serializeObject(o);
116 var serializedWithoutVersion = new Uint8Array(serialized, 2); 116 var serializedWithoutVersion = new Uint8Array(serialized, 4);
117 debug("Serialized key bytes: " + bytesToHexString(serializedWithoutVersi on)); 117 debug("Serialized key bytes: " + bytesToHexString(serializedWithoutVersi on));
118 } 118 }
119 } 119 }
120 120
121 function shouldEvaluateAs(actual, expectedValue) 121 function shouldEvaluateAs(actual, expectedValue)
122 { 122 {
123 if (typeof expectedValue == "string") 123 if (typeof expectedValue == "string")
124 return shouldBeEqualToString(actual, expectedValue); 124 return shouldBeEqualToString(actual, expectedValue);
125 return shouldEvaluateTo(actual, expectedValue); 125 return shouldEvaluateTo(actual, expectedValue);
126 } 126 }
(...skipping 30 matching lines...) Expand all
157 // Expected to succeed. 157 // Expected to succeed.
158 debug("SUCCESS"); 158 debug("SUCCESS");
159 return result; 159 return result;
160 }, function(error) { 160 }, function(error) {
161 debug("FAILED: " + error.toString()); 161 debug("FAILED: " + error.toString());
162 162
163 // Re-throw the error. 163 // Re-throw the error.
164 throw new Error("Test FAILED: " + message); 164 throw new Error("Test FAILED: " + message);
165 }); 165 });
166 } 166 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698