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

Side by Side Diff: LayoutTests/fast/workers/worker-timeout-cancel-order.html

Issue 563203002: [Blink-WebWorkers] WorkerSharedTimer cancels extra delayed tasks. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix for Linux ASAN crash. Created 6 years, 2 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <p>Test setTimeOut,cancelTimeout in Web Workers.</p>
5 <div id="result"></div>
6 <script type="text/javascript">
7 function log(message)
8 {
9 document.getElementById("result").innerHTML += message + "</br>";
10 }
11
12 if (window.testRunner) {
13 testRunner.dumpAsText();
14 testRunner.waitUntilDone();
15 }
16
17 var worker = new Worker('resources/worker-timeout-cancel-order.js');
18 var testAlreadyFailed = false;
19
20 worker.postMessage("TS");
21
22 worker.onmessage = function(evt) {
23 if (evt.data == "DONE") {
24 log("DONE.");
25 if (window.testRunner)
26 testRunner.notifyDone();
27 }
28 if(2 == evt.data && !testAlreadyFailed) {
29 log("PASS: Timeout canceled.");
30 }
31 else if(1 == evt.data) {
32 testAlreadyFailed = true;
33 log("FAIL: Timeout did not cancel.");
34 }
35 if(evt.data == "Test started.") {
36 log(evt.data);
37 }
38 }
39 </script>
40 </body>
41 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698