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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/service-worker-error-event.html

Issue 2804533002: Update Error Event inside a worker to provide the exact exception value (Closed)
Patch Set: fix nits Created 3 years, 8 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/http/tests/serviceworker/ServiceWorkerGlobalScope/service-worker-error-event.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/service-worker-error-event.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/service-worker-error-event.html
new file mode 100644
index 0000000000000000000000000000000000000000..ded2ec1dd48f8b1fdd8edc4d02d668bd8fe69026
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/service-worker-error-event.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
nhiroki 2017/04/06 01:50:35 We could move this test into LayoutTests/external/
shimazu 2017/04/06 02:30:48 Along with moving the test under wpt, you should c
yiyix 2017/04/06 04:38:19 i can't find this directory, do you mean LayoutTes
nhiroki 2017/04/06 04:56:44 Yes!
+<title>ServiceWorkerGlobalScope: Error event error message</title>
+<script src='../../resources/testharness.js'></script>
+<script src='../../resources/testharnessreport.js'></script>
+<script src='../resources/test-helpers.js'></script>
+<script>
+promise_test(function(t) {
+ var script = 'resources/error-worker-script.js';
nhiroki 2017/04/06 01:50:35 We conventionally use "-worker.js" suffix for work
yiyix 2017/04/06 04:38:19 Done.
+ var scope = 'resources/scope/service-worker-error-event';
+ var serviceworker;
+ return service_worker_unregister_and_register(t, script, scope)
+ .then(function(registration) {
+ serviceworker = registration.installing;
+ })
+ .then(function() {
nhiroki 2017/04/06 01:50:35 Lines 14-15 are not necessary: .then(registrati
yiyix 2017/04/06 04:38:19 Done.
+ return new Promise(function(resolve) {
+ navigator.serviceWorker.onmessage = resolve;
+ serviceworker.postMessage('');
+ });
+ })
+ .then(function(e) {
+ assert_equals(e.data.value, 'testError');
+ });
+ }, 'Error handlers inside serviceworker should see the error value');
+</script>

Powered by Google App Engine
This is Rietveld 408576698