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

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/workers/Worker_ErrorEvent_error.htm

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/Worker_ErrorEvent_error.htm
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/workers/Worker_ErrorEvent_error.htm b/third_party/WebKit/LayoutTests/imported/wpt/workers/Worker_ErrorEvent_error.htm
new file mode 100644
index 0000000000000000000000000000000000000000..1c1257d1bd22d56c04303bb6f81ec6a8222c8940
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/wpt/workers/Worker_ErrorEvent_error.htm
@@ -0,0 +1,29 @@
+<!doctype html>
+<meta charset=utf-8>
+<title></title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script>
+var t1 = async_test("Error handler outside the worker should not see the error value");
+var t2 = async_test("Error handlers inside a worker should see the error value");
+
+test(function() {
+ var worker = new Worker("support/ErrorEvent-error.js");
+ worker.onerror = t1.step_func_done(function(e) {
+ assert_true(/hello/.test(e.message));
+ assert_equals(e.error, null);
+ });
+
+ var messages = 0;
+ worker.onmessage = t2.step_func(function(e) {
+ ++messages;
+ var data = e.data;
+ assert_true(data.source == "onerror" ||
+ data.source == "event listener");
+ assert_equals(data.value, "hello");
+ if (messages == 2) {
+ t2.done();
+ }
+ });
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698