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

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/workers/semantics/reporting-errors/002.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/semantics/reporting-errors/002.html
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/workers/semantics/reporting-errors/002.html b/third_party/WebKit/LayoutTests/imported/wpt/workers/semantics/reporting-errors/002.html
new file mode 100644
index 0000000000000000000000000000000000000000..c2cd377b435d8bb39dc6381301d180d84d1da4da
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/wpt/workers/semantics/reporting-errors/002.html
@@ -0,0 +1,59 @@
+<!--
+var port;
+var timeout;
+addEventListener('error', function(e) {
+ // event is not canceled, thus the error is "not handled"
+ // so error should be reported to the user, but this test doesn't check
+ // that.
+ // just make sure that this event has the right properties
+ clearTimeout(timeout);
+ var log = '';
+ if (!self.ErrorEvent || Object.getPrototypeOf(e) != ErrorEvent.prototype)
+ log += 'event should be an ErrorEvent. ';
+ if (e.bubbles)
+ log += 'event should not bubble. ';
+ if (!e.cancelable)
+ log += 'event should be cancelable. ';
+ if (!e.isTrusted)
+ log += 'event should be trusted. ';
+ if (typeof e.message != 'string')
+ log += 'message wasn\'t a string. ';
+ if (e.filename != location.href)
+ log += 'filename was ' + e.filename + ', expected ' + location.href + '. ';
+ if (typeof e.lineno != 'number')
+ log += 'lineno wasn\'t a number. ';
+ if (typeof e.colno != 'number')
+ log += 'colno argument wasn\'t a number. ';
+ if (e.error != 42)
+ log += 'fifth argument wasn\'t the thrown exception. ';
+ port.postMessage(log);
+}, false);
+onconnect = function (e) {
+ port = e.ports[0];
+ timeout = setTimeout(function() { port.postMessage('No error event fired'); }, 250);
+ throw 42; // will "report the error"
+}
+
+
+/*
+-->
+<!doctype html>
+<title>shared worker, addEventListener</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id=log></div>
+<script>
+setup({allow_uncaught_exception:true});
+async_test(function() {
+ window.onerror = this.step_func(function(a) {
+ assert_unreached('window.onerror invoked: ' + a);
+ });
+ var worker = new SharedWorker('#', '');
+ worker.port.onmessage = this.step_func_done(function(e) {
+ assert_equals(e.data, '');
+ });
+});
+</script>
+<!--
+*/
+//-->

Powered by Google App Engine
This is Rietveld 408576698