| 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);
|
| + 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);
|
| + 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;
|
| +}
|
|
|