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

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

Issue 2875383002: Upstream service worker `postMessage` tests to WPT (Closed)
Patch Set: Incorporate review feedback Created 3 years, 7 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/postmessage-msgport-to-client.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/postmessage-msgport-to-client.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/postmessage-msgport-to-client.html
deleted file mode 100644
index e00d72c2d4d1488f745135293c7e128c30301063..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/postmessage-msgport-to-client.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<!DOCTYPE html>
-<title>Service Worker: postMessage to Client</title>
-<script src="../resources/testharness.js"></script>
-<script src="../resources/testharnessreport.js"></script>
-<script src="resources/test-helpers.js"></script>
-<script>
-
-promise_test(t => {
- var script = 'resources/postmessage-msgport-to-client-worker.js';
- var scope = 'resources/blank.html';
- var port;
-
- return service_worker_unregister_and_register(t, script, scope)
- .then(registration => {
- add_completion_callback(() => registration.unregister());
- return wait_for_state(t, registration.installing, 'activated');
- })
- .then(() => with_iframe(scope))
- .then(frame => {
- return new Promise(resolve => {
- var w = frame.contentWindow;
- w.navigator.serviceWorker.onmessage = resolve;
- w.navigator.serviceWorker.controller.postMessage('ping');
- });
- })
- .then(e => {
- port = e.ports[0];
- port.postMessage({value: 1});
- port.postMessage({value: 2});
- port.postMessage({done: true});
- return new Promise(resolve => { port.onmessage = resolve; });
- })
- .then(e => {
- assert_equals(e.data.ack, 'Acking value: 1');
- return new Promise(resolve => { port.onmessage = resolve; });
- })
- .then(e => {
- assert_equals(e.data.ack, 'Acking value: 2');
- return new Promise(resolve => { port.onmessage = resolve; });
- })
- .then(e => { assert_true(e.data.done); });
- }, 'postMessage MessagePorts from ServiceWorker to Client');
-
-</script>

Powered by Google App Engine
This is Rietveld 408576698