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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/workers/constructors/Worker/terminate.html

Issue 2418853003: Worker: Import "imported/wpt/workers" tests (Retry) (Closed)
Patch Set: rebase Created 4 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 <!--
2 (function f() {
3 postMessage(1);
4 setTimeout(f, 0);
5 })();
6 /*
7 -->
8 <!doctype html>
9 <title>terminate()</title>
10 <link rel=help href="http://www.whatwg.org/html/#dom-worker-terminate">
11 <script src="/resources/testharness.js"></script>
12 <script src="/resources/testharnessreport.js"></script>
13 <div id="log"></div>
14 <script>
15 var t = async_test();
16 t.step(function() {
17 var worker = new Worker('#');
18 var i = 0;
19 var expected;
20
21 worker.onmessage = t.step_func(function() {
22 i++;
23 });
24
25 setTimeout(t.step_func(function() {
26 expected = i;
27 start_time = Date.now();
28 //Hang the main thread for a bit to give the worker the chance to post some more messages
29 while(Date.now() - start_time < 500) {
30 //pass
31 }
32 worker.terminate();
33
34 setTimeout(t.step_func(function() {
35 assert_equals(i, expected);
36 t.done();
37 }), 100);
38
39 }), 100);
40 });
41 </script>
42 <!--
43 */
44 //-->
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698