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

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

Issue 256483004: Remove serialization version tags from crypto LayoutTests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
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
« 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 function shouldBeTypeError(toEval) 1 function shouldBeTypeError(toEval)
2 { 2 {
3 var value = eval(toEval); 3 var value = eval(toEval);
4 if (value instanceof TypeError) { 4 if (value instanceof TypeError) {
5 testPassed(toEval + " is: " + value.toString()); 5 testPassed(toEval + " is: " + value.toString());
6 } else { 6 } else {
7 testFailed(toEval + " is not a TypeError: " + value); 7 testFailed(toEval + " is not a TypeError: " + value);
8 } 8 }
9 } 9 }
10 10
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 return new Promise(function(resolve, reject) { 93 return new Promise(function(resolve, reject) {
94 self.callbacks.push(resolve); 94 self.callbacks.push(resolve);
95 self.channel.port2.postMessage(key); 95 self.channel.port2.postMessage(key);
96 }); 96 });
97 } 97 }
98 98
99 // Logging the serialized format ensures that if it changes it will break tests. 99 // Logging the serialized format ensures that if it changes it will break tests.
100 function logSerializedKey(o) 100 function logSerializedKey(o)
101 { 101 {
102 if (internals) 102 if (internals) {
103 debug("Serialized key bytes: " + bytesToHexString(internals.serializeObj ect(o))); 103 // Removing the version tag from the output so serialization format chan ges don't need to update all the crypto tests.
104 var serialized = internals.serializeObject(o);
105 var serializedWithoutVersion = new Uint8Array(serialized, 2);
106 debug("Serialized key bytes: " + bytesToHexString(serializedWithoutVersi on));
107 }
104 } 108 }
105 109
106 function shouldEvaluateAs(actual, expectedValue) 110 function shouldEvaluateAs(actual, expectedValue)
107 { 111 {
108 if (typeof expectedValue == "string") 112 if (typeof expectedValue == "string")
109 return shouldBeEqualToString(actual, expectedValue); 113 return shouldBeEqualToString(actual, expectedValue);
110 return shouldEvaluateTo(actual, expectedValue); 114 return shouldEvaluateTo(actual, expectedValue);
111 } 115 }
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