mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
Bug 1581477 - enable dom/serviceworkers/test/test_third_party_iframes.html for fission r=dom-workers-and-storage-reviewers,perry
Differential Revision: https://phabricator.services.mozilla.com/D56944 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
d28cd2116b
commit
9631b4bcb3
@ -317,8 +317,6 @@ skip-if = serviceworker_e10s
|
||||
[test_streamfilter.html]
|
||||
[test_strict_mode_warning.html]
|
||||
[test_third_party_iframes.html]
|
||||
skip-if =
|
||||
fission # Fails uncleanly: /tests/dom/serviceworkers/test/test_third_party_iframes.html logged result after SimpleTest.finish(): This test left a service worker registered without cleaning it up
|
||||
support-files =
|
||||
window_party_iframes.html
|
||||
[test_unregister.html]
|
||||
|
@ -39,9 +39,7 @@ let basePath = "/tests/dom/serviceworkers/test/thirdparty/";
|
||||
let origin = window.location.protocol + "//" + window.location.host;
|
||||
let thirdPartyOrigin = "https://example.com";
|
||||
|
||||
function testIframeLoaded() {
|
||||
ok(true, "Iframe loaded");
|
||||
iframe.removeEventListener("load", testIframeLoaded);
|
||||
function loadIframe() {
|
||||
let message = {
|
||||
source: "parent",
|
||||
href: origin + basePath + "iframe2.html"
|
||||
@ -92,9 +90,11 @@ function testShouldIntercept(behavior, lifetime, done) {
|
||||
}, {
|
||||
status: "registrationdone",
|
||||
next() {
|
||||
iframe.addEventListener("load", testIframeLoaded);
|
||||
iframe.src = origin + basePath + "iframe1.html";
|
||||
}
|
||||
}, {
|
||||
status: "iframeloaded",
|
||||
next: loadIframe
|
||||
}, {
|
||||
status: "networkresponse",
|
||||
}, {
|
||||
@ -131,9 +131,11 @@ function testShouldNotRegister(behavior, lifetime, done) {
|
||||
runTest([{
|
||||
status: "registrationfailed",
|
||||
next() {
|
||||
iframe.addEventListener("load", testIframeLoaded);
|
||||
iframe.src = origin + basePath + "iframe1.html";
|
||||
}
|
||||
}, {
|
||||
status: "iframeloaded",
|
||||
next: loadIframe
|
||||
}, {
|
||||
status: "networkresponse",
|
||||
}, {
|
||||
@ -174,11 +176,13 @@ function testShouldNotIntercept(behavior, lifetime, done) {
|
||||
proxyWindow = window.open("window_party_iframes.html");
|
||||
proxyWindow.onload = _ => {
|
||||
iframe = proxyWindow.document.querySelector("iframe");
|
||||
iframe.addEventListener("load", testIframeLoaded);
|
||||
iframe.src = origin + basePath + "iframe1.html";
|
||||
}
|
||||
});
|
||||
}
|
||||
}, {
|
||||
status: "iframeloaded",
|
||||
next: loadIframe
|
||||
}, {
|
||||
status: "networkresponse",
|
||||
}, {
|
||||
@ -204,7 +208,6 @@ function testShouldNotIntercept(behavior, lifetime, done) {
|
||||
proxyWindow = window.open("window_party_iframes.html");
|
||||
proxyWindow.onload = _ => {
|
||||
iframe = proxyWindow.document.querySelector("iframe");
|
||||
iframe.addEventListener("load", testIframeLoaded);
|
||||
iframe.src = thirdPartyOrigin + basePath + "unregister.html";
|
||||
}
|
||||
});
|
||||
|
12
dom/serviceworkers/test/thirdparty/iframe1.html
vendored
12
dom/serviceworkers/test/thirdparty/iframe1.html
vendored
@ -25,7 +25,17 @@
|
||||
|
||||
</head>
|
||||
|
||||
<body onload="window.addEventListener('message', messageListener, false);">
|
||||
<body>
|
||||
<script>
|
||||
onload = function() {
|
||||
window.addEventListener('message', messageListener);
|
||||
let message = {
|
||||
source: "iframe",
|
||||
status: "iframeloaded",
|
||||
}
|
||||
parent.postMessage(message, "*");
|
||||
}
|
||||
</script>
|
||||
<iframe id="iframe2"></iframe>
|
||||
</body>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user