Index: LayoutTests/crypto/resources/common.js |
diff --git a/LayoutTests/crypto/resources/common.js b/LayoutTests/crypto/resources/common.js |
index 591044aa641455d00a7d76c0d787ebf9bc79bcc1..2189674bad50a0a7d9abe71debdf1273d8eb9ffa 100644 |
--- a/LayoutTests/crypto/resources/common.js |
+++ b/LayoutTests/crypto/resources/common.js |
@@ -106,13 +106,19 @@ function addTask(promise) |
{ |
numOutstandingTasks++; |
- function taskFinished() |
+ function taskSucceeded() |
{ |
numOutstandingTasks--; |
completeTestWhenAllTasksDone(); |
} |
- promise.then(taskFinished, taskFinished); |
+ function taskFailed(error) |
+ { |
+ debug('Task failed: ' + error); |
jsbell
2014/03/13 20:16:07
testFailed() ?
Looks like testPassed() / testFail
eroman
2014/03/14 05:24:33
I have removed this change, and am building a sing
|
+ taskSucceeded(); |
+ } |
+ |
+ promise.then(taskSucceeded, taskFailed); |
} |
function completeTestWhenAllTasksDone() |
@@ -158,3 +164,21 @@ function shouldAcceptPromise(code) |
addTask(promise.then(acceptCallback, rejectCallback)); |
} |
+ |
+function cloneKeyAndLog(key) |
+{ |
+ var serialized = internals.serializeObject(key); |
jsbell
2014/03/13 20:16:07
Obviously, this won't work in a browser. At the ex
eroman
2014/03/14 05:24:33
Great idea, done!
|
+ debug("Serialized key bytes: " + bytesToHexString(serialized)); |
+ return internals.deserializeBuffer(serialized); |
+} |
+ |
+// Convert 'x' into a string which can be passed to "shouldBe()" |
+function evalWrap(x) |
+{ |
+ var asString = '' + x; |
+ |
+ if (typeof x == 'string') |
+ asString = '"' + asString + '"'; |
+ |
+ return asString; |
+} |