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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/insecure-parent.html

Issue 2869093002: Upstream Service Worker window test to WPT
Patch Set: 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/external/wpt/service-workers/service-worker/resources/insecure-parent.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/insecure-parent.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/insecure-parent.html
similarity index 50%
rename from third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/insecure-parent.html
rename to third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/insecure-parent.html
index 52a066a06917b119374e0c19c2bff54686fe500a..3e1d2730311b214b1786d6e73879d6cfbb2b94b6 100644
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/insecure-parent.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/insecure-parent.html
@@ -1,16 +1,21 @@
<!DOCTYPE html>
<meta charset="utf-8">
-<script src="../../resources/get-host-info.js?pipe=sub"></script>
+<script src="/common/get-host-info.sub.js"></script>
<title>Page Title</title>
<body></body>
<script>
var iframe = document.createElement('iframe');
iframe.src = get_host_info().HTTP_ORIGIN +
Marijn Kruisselbrink 2017/05/16 18:31:25 Is this the right origin? If I understand things c
falken 2017/05/17 05:47:56 Good catch, I think you're right. When I disable
mike3 2017/05/18 15:48:00 Acknowledged.
- '/serviceworker/resources/insecure-inscope.html';
+ '/service-workers/service-worker/resources/insecure-inscope.html';
document.body.appendChild(iframe);
+window.addEventListener('load', function() {
+ opener.postMessage('loaded', '*');
+ });
+
// The top frame messages us to message the subframe.
window.addEventListener('message', e => {
- iframe.contentWindow.postMessage(e.data, '*');
+ var target = e.source === opener ? iframe.contentWindow : opener;
+ target.postMessage(e.data, '*');
});
</script>

Powered by Google App Engine
This is Rietveld 408576698