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

Side by Side Diff: LayoutTests/crypto/abandon-crypto-operation2.html

Issue 806913006: [WebCrypto] Move LayoutTests from crypto to crypto/subtle (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update path for deserialize legacy tests Created 6 years 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../resources/js-test.js"></script>
5 <script src="resources/common.js"></script>
6 </head>
7 <body>
8 <p id="description"></p>
9 <div id="console"></div>
10
11 <script>
12 description("Tests cancelling of crypto operations when the context is destr oyed.");
13
14 // Start a worker thread which starts a LOT of expensive
15 // webcrypto operations (generating RSA keys).
16 //
17 // Now from the main page try to generate an AES key.
18 //
19 // Lastly, the web worker closes itself. This should have the
20 // effect of aborting all of the web crypto operations it had
21 // started, and now the AES key generation will be able to complete.
22 //
23 // If the crypto tasks started by the web worker are NOT
24 // cancelled (and are merely orphaned), then the test is going to
25 // timeout.
26 jsTestIsAsync = true;
27
28 function startWorker() {
29 return new Promise(function(resolve, reject) {
30 var worker = new Worker("resources/worker-start-slow-operations.js") ;
31 worker.onmessage = function(event)
32 {
33 debug(event.data);
34 resolve();
35 };
36 worker.onerror = function(error)
37 {
38 debug(error.filename + ':' + error.lineno + ': ' + error.message );
39 reject('worker failed');
40 }
41 });
42 }
43
44 function generateTestKey() {
45 var algorithm = {name: "AES-CBC", length: 128};
46 return crypto.subtle.generateKey(algorithm, true, ['encrypt']).then(func tion() {
47 debug('Successfully generated AES-CBC key');
48 });
49 }
50
51 startWorker().then(generateTestKey).then(finishJSTest, failAndFinishJSTest);
52 </script>
53 </body>
54 </html>
OLDNEW
« no previous file with comments | « LayoutTests/crypto/abandon-crypto-operation-expected.txt ('k') | LayoutTests/crypto/abandon-crypto-operation2-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698