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

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: update tests 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..9116582464084482b438802f0f5cce70904f414e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/service-worker-error-event.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<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';
+ var scope = 'resources/scope/service-worker-error-event';
+ var serviceworker;
+ return service_worker_unregister_and_register(t, script, scope)
+ .then(function(registration) {
shimazu 2017/04/05 09:29:40 +2 indent; promise_test(() => { return servic
yiyix 2017/04/05 09:56:57 Done.
+ serviceworker = registration.installing;
+ })
+ .then(function() {
+ return new Promise(function(resolve) {
+ navigator.serviceWorker.onmessage = resolve;
+ serviceworker.postMessage('');
+ });
+ })
+ .then(function(e) {
+ assert_equals(e.value, 'testError');
shimazu 2017/04/05 09:29:40 e.data.value
yiyix 2017/04/05 09:56:57 Done.
+ })
+ }, 'Error handlers inside serviceworker should see the error value');
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698