Index: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/install-worker-helper.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/install-worker-helper.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/install-worker-helper.html |
similarity index 79% |
rename from third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/install-worker-helper.html |
rename to third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/install-worker-helper.html |
index 1de9baffb756e809e3b6378d58cb02ff4aeb94a3..fcb8f6d83c7e0e4b3a0b97ed29ca5add248d091e 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/install-worker-helper.html |
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/install-worker-helper.html |
@@ -1,8 +1,7 @@ |
<!DOCTYPE html> |
-<script src="test-helpers.js"></script> |
+<script src="test-helpers.sub.js"></script> |
<script> |
window.addEventListener('message', event => { |
- var port = event.ports[0]; |
navigator.serviceWorker.getRegistration(event.data.options.scope) |
.then(r => { |
if (r) return r.unregister(); |
@@ -16,7 +15,7 @@ window.addEventListener('message', event => { |
if (worker.state === 'activated') resolve(); |
}); |
})) |
- .then(() => port.postMessage('success')) |
- .catch((e) => port.postMessage('failure:' + e)); |
+ .then(() => event.source.postMessage('success', '*')) |
+ .catch((e) => event.source.postMessage('failure:' + e, '*')); |
}); |
</script> |