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

Unified Diff: LayoutTests/crypto/abandon-crypto-operation.html

Issue 263163006: Fix crash when ExecutionContext is torn down before a crypto operation has completed. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix comment typo Created 6 years, 7 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 | « no previous file | LayoutTests/crypto/abandon-crypto-operation-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/crypto/abandon-crypto-operation.html
diff --git a/LayoutTests/crypto/abandon-crypto-operation.html b/LayoutTests/crypto/abandon-crypto-operation.html
new file mode 100644
index 0000000000000000000000000000000000000000..49b9b3fd2e116378143cdf224ca4945f3e82f1c1
--- /dev/null
+++ b/LayoutTests/crypto/abandon-crypto-operation.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../resources/js-test.js"></script>
+<script src="resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+ description("Tests abandoning a crypto operation.");
+
+ // This test starts up a couple worker threads, which continuously generate
+ // RSA keys. It waits until each of the worker threads have started
+ // running, and then exits.
+ //
+ // The consequence is that once the test finishes, there should be
+ // outstanding crypto operations on the worker threads. This will exercise
+ // the cancellation/abandonment logic for these Promises.
+
+ jsTestIsAsync = true;
+
+ var allPromises = [];
+
+ var kNumWorkers = 3;
+
+ for (var i = 0; i < kNumWorkers; ++i) {
+ allPromises.push(new Promise(function(resolve, reject) {
+ var worker = new Worker("resources/worker-infinite-loop-generateKey.js");
+ worker.onmessage = function(event)
+ {
+ debug(event.data);
+ resolve();
+ };
+ }));
+ }
+
+ Promise.all(allPromises).then(finishJSTest);
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/crypto/abandon-crypto-operation-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698