Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/postmessage.https.html |
| diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/postmessage.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/postmessage.https.html |
| index a6f66517910eefd54abc722c7cf16a7d6f3794ac..9d7b5cd87f41fd1946659d4d561a779433ccc039 100644 |
| --- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/postmessage.https.html |
| +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/postmessage.https.html |
| @@ -57,4 +57,31 @@ async_test(function(t) { |
| .catch(unreached_rejection(t)); |
| } |
| }, 'postMessage to a ServiceWorker (and back via MessagePort)'); |
| + |
|
Marijn Kruisselbrink
2017/05/30 19:24:41
did you intend to have this as part of this change
mike3
2017/05/30 21:22:32
No, I did not. This was part of my research regard
|
| + |
| +promise_test(function(t) { |
| + var scope = 'resources/blank.html'; |
| + var worker; |
| + |
| + return service_worker_unregister_and_register( |
| + t, 'resources/postmessage-worker.js', scope) |
| + .then(function(registration) { |
| + worker = registration.installing; |
| + return new Promise(function(resolve) { |
| + worker.addEventListener('statechange', function(event) { |
| + if (event.target.state === 'activated') { |
| + resolve(registration); |
| + } |
| + }); |
| + }); |
| + }) |
| + .then(function(registration) { |
| + return registration.unregister(); |
| + }) |
| + .then(function() { |
| + assert_throws({ name: 'InvalidStateError' }, function() { |
| + worker.postMessage({}); |
| + }); |
| + }); |
| + }, 'invoked on a redundant worker'); |
| </script> |