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

Unified Diff: LayoutTests/crypto/resources/common.js

Issue 195543002: [webcrypto] Implement structured clone of keys (blink-side). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix another comment Created 6 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 side-by-side diff with in-line comments
Download patch
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;
+}

Powered by Google App Engine
This is Rietveld 408576698