Bug 1656828 [wpt PR 24850] - [WPT] Migrate some worker.onerror tests to WPT, a=testonly
authorHiroshige Hayashizaki <hiroshige@chromium.org>
Fri, 07 Aug 2020 12:40:37 +0000
changeset 544799 23fbaa3e2e2f9e7051e9dd459b8f2a11ead939e5
parent 544798 41fb0a24b2ccdd1ebe061d0af9b9f4e6bca92493
child 544800 bf0e3f01b294e5605b27abb2d8eff2ecc1e8cd2f
push id124254
push userwptsync@mozilla.com
push dateSat, 15 Aug 2020 07:08:45 +0000
treeherderautoland@3f1068b2fb00 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1656828, 24850, 1050039, 795636, 2332090, 794028
milestone81.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1656828 [wpt PR 24850] - [WPT] Migrate some worker.onerror tests to WPT, a=testonly Automatic update from web-platform-tests [WPT] Migrate some worker.onerror tests to WPT This CL - Adds a worker.addEventListener() case in /wpt/workers/interfaces/WorkerGlobalScope/onerror/not-handled.html to migrate worker-onerror-03.html. - Removes some other third_party/blink/web_tests/fast/workers/worker-onerror-* tests already covered by WPTs, and - Removes flaky TestExpectations for third_party/blink/web_tests/fast/workers/worker-onerror-* that look no longer flaky. Bug: 1050039, 795636 Change-Id: Ia309e69acf3fe083c947533b0b2961fc1096d3ee Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2332090 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Kenichi Ishibashi <bashi@chromium.org> Cr-Commit-Position: refs/heads/master@{#794028} -- wpt-commits: e02f0bd2d6a427f879ea59621401a58943d9ba5a wpt-pr: 24850
testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/onerror/not-handled.html
--- a/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/onerror/not-handled.html
+++ b/testing/web-platform/tests/workers/interfaces/WorkerGlobalScope/onerror/not-handled.html
@@ -1,19 +1,28 @@
 <!doctype html>
 <title>onerror, "not handled"</title>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <div id="log"></div>
 <script>
-async_test(function() {
-  var worker = new Worker('not-handled.js');
-  worker.onerror = this.step_func(function(e) {
+function createHandler(t) {
+  return t.step_func(function(e) {
     assert_true(e instanceof ErrorEvent, 'e instanceof ErrorEvent');
     assert_equals(typeof e.message, 'string', 'typeof e.message');
     assert_equals(e.filename, document.URL.replace('.html', '.js'), 'e.filename');
     assert_equals(typeof e.lineno, 'number', 'typeof e.lineno');
     assert_equals(typeof e.colno, 'number', 'typeof e.column');
     e.preventDefault(); // "handled"
-    this.done();
+    t.done();
   });
-});
-</script>
\ No newline at end of file
+}
+
+async_test(function(t) {
+  var worker = new Worker('not-handled.js');
+  worker.onerror = createHandler(t);
+}, 'Not handled evaluation error => Worker.onerror handler');
+
+async_test(function(t) {
+  var worker = new Worker('not-handled.js');
+  worker.addEventListener('error', createHandler(t));
+}, 'Not handled evaluation error => Worker error listener');
+</script>