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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/postmessage-to-client.html

Issue 2466513002: Deprecate ServiceWorkerMessageEvent in favor of MessageEvent (Closed)
Patch Set: Merge layout tests; add arg name comments; cleanup global-interface-listing-expected files. Created 4 years, 1 month 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/postmessage-to-client.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/postmessage-to-client.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/postmessage-to-client.html
index fadc7d2a51cdea387b23bb4bfcd14449598a26e4..5378ced3891cf8674bb0f6b97e122ba2d945202c 100644
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/postmessage-to-client.html
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/postmessage-to-client.html
@@ -25,16 +25,28 @@ promise_test(t => {
})
.then(e => {
var message = e.data;
- assert_equals(e.origin, location.origin,
- 'origin of message should be origin of Service Worker');
+ assert_equals(self.ServiceWorkerMessageEvent, undefined,
+ 'ServiceWorkerMessageEvent should not be defined.');
nhiroki 2016/11/15 03:42:15 This assertion wouldn't be necessary because it's
jungkees 2016/11/15 16:06:49 Removed this assertion.
+ assert_equals(e.constructor, w.MessageEvent,
+ 'message events should use MessageEvent interface.');
+ assert_equals(e.type, 'message', 'type should be "message".');
+ assert_equals(
+ e.origin, location.origin,
+ 'origin of message should be origin of Service Worker.');
assert_equals(e.lastEventId, '',
- 'lastEventId should be an empty string');
+ 'lastEventId should be an empty string.');
+ assert_equals(e.source.constructor, w.ServiceWorker,
+ 'source should use ServiceWorker interface.');
+ assert_equals(
+ e.source, w.navigator.serviceWorker.controller,
+ 'source should be the service worker that sent the message.');
+ assert_equals(e.ports.length, 0, 'ports should be an empty array.');
assert_equals(message, 'Sending message via clients');
return new Promise(resolve => {
w.navigator.serviceWorker.onmessage = resolve;
});
})
.then(e => { assert_equals(e.data, 'quit'); });
- }, 'postMessage from ServiceWorker to Client');
+ }, 'postMessage from ServiceWorker to Client.');
</script>

Powered by Google App Engine
This is Rietveld 408576698