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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/clients-get-cross-origin-frame.html

Issue 2778903002: Upstream service worker `client` tests to WPT (Closed)
Patch Set: Remove unnecessary branch Created 3 years, 9 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/external/wpt/service-workers/service-worker/resources/clients-get-cross-origin-frame.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/clients-get-cross-origin-frame.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/clients-get-cross-origin-frame.html
similarity index 76%
rename from third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/clients-get-cross-origin-frame.html
rename to third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/clients-get-cross-origin-frame.html
index 0977600366e63709f87a2d69c5fcf8a6304cb85f..eaade327bc59d8f2e38c56766c39973f1ec41426 100644
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/clients-get-cross-origin-frame.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/clients-get-cross-origin-frame.html
@@ -1,8 +1,8 @@
<!DOCTYPE html>
-<script src="../../resources/testharness.js"></script>
-<script src="../../resources/testharnessreport.js"></script>
-<script src="../../resources/get-host-info.js"></script>
-<script src="test-helpers.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="test-helpers.sub.js"></script>
<script>
var host_info = get_host_info();
var scope = 'blank.html?clients-get';
@@ -29,14 +29,7 @@ var wait_for_worker_promise = navigator.serviceWorker.getRegistration(scope)
});
});
-function send_result(result) {
- window.parent.postMessage(
- {result: result},
- host_info['HTTP_ORIGIN']);
-}
-
window.addEventListener('message', function(e) {
- assert_equals(e.origin, host_info['HTTP_ORIGIN']);
var cross_origin_client_ids = [];
cross_origin_client_ids.push(e.data.clientId);
wait_for_worker_promise
@@ -48,7 +41,9 @@ window.addEventListener('message', function(e) {
var channel = new MessageChannel();
channel.port1.onmessage = function(e) {
registration.unregister();
- send_result(e.data);
+ window.parent.postMessage(
+ { type: 'clientId', value: e.data }, host_info['HTTPS_ORIGIN']
+ );
};
iframe.contentWindow.navigator.serviceWorker.controller.postMessage(
{port:channel.port2, clientIds: cross_origin_client_ids},

Powered by Google App Engine
This is Rietveld 408576698