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

Unified Diff: LayoutTests/crypto/resources/worker-start-slow-operations.js

Issue 343723003: [webcrypto] Allow crypto operations to be cancelled by the platform implementation. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix comment typo Created 6 years, 6 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
« no previous file with comments | « LayoutTests/crypto/abandon-crypto-operation2-expected.txt ('k') | Source/modules/crypto/CryptoResultImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/crypto/resources/worker-start-slow-operations.js
diff --git a/LayoutTests/crypto/resources/worker-start-slow-operations.js b/LayoutTests/crypto/resources/worker-start-slow-operations.js
new file mode 100644
index 0000000000000000000000000000000000000000..53a1def9f32f18499128833db7eae597aeda29e9
--- /dev/null
+++ b/LayoutTests/crypto/resources/worker-start-slow-operations.js
@@ -0,0 +1,20 @@
+function generateRsaKey()
+{
+ var extractable = false;
+ var usages = ['sign', 'verify'];
+ var algorithm = {name: "RSASSA-PKCS1-v1_5", modulusLength: 512, publicExponent: new Uint8Array([1, 0, 1]), hash: {name: 'sha-1'}};
+
+ return crypto.subtle.generateKey(algorithm, extractable, usages).then(undefined, function(error) {
+ postMessage(error);
+ });
+}
+
+// Start many concurrent operations but don't do anything with the result, or
+// even wait for them to complete.
+for (var i = 0; i < 1000; ++i)
+ generateRsaKey();
+
+// Inform the outer script that the worker started.
+postMessage("Worker started");
+
+close();
« no previous file with comments | « LayoutTests/crypto/abandon-crypto-operation2-expected.txt ('k') | Source/modules/crypto/CryptoResultImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698