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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/imported/wpt/workers/constructors/Worker/terminate.html
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/workers/constructors/Worker/terminate.html b/third_party/WebKit/LayoutTests/imported/wpt/workers/constructors/Worker/terminate.html
new file mode 100644
index 0000000000000000000000000000000000000000..52f9707dfede606e1ecf6d461467d61fa0eb6fce
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/wpt/workers/constructors/Worker/terminate.html
@@ -0,0 +1,44 @@
+<!--
+(function f() {
+ postMessage(1);
+ setTimeout(f, 0);
+})();
+/*
+-->
+<!doctype html>
+<title>terminate()</title>
+<link rel=help href="http://www.whatwg.org/html/#dom-worker-terminate">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+var t = async_test();
+t.step(function() {
+ var worker = new Worker('#');
+ var i = 0;
+ var expected;
+
+ worker.onmessage = t.step_func(function() {
+ i++;
+ });
+
+ setTimeout(t.step_func(function() {
+ expected = i;
+ start_time = Date.now();
+ //Hang the main thread for a bit to give the worker the chance to post some more messages
+ while(Date.now() - start_time < 500) {
+ //pass
+ }
+ worker.terminate();
+
+ setTimeout(t.step_func(function() {
+ assert_equals(i, expected);
+ t.done();
+ }), 100);
+
+ }), 100);
+});
+</script>
+<!--
+*/
+//-->

Powered by Google App Engine
This is Rietveld 408576698