Commit a438ac38 authored by Chromium WPT Sync's avatar Chromium WPT Sync Committed by Commit Bot

Import wpt@9b38d0ac614a4132804b076c461738871689fae7

Using wpt-import in Chromium e723c6de.
With Chromium commits locally applied on WPT:
d5cd6b98 "SharedWorker: Assign unique names to SharedWorkers to avoid unintentional matching"
76ee218c "Split html/.../query-encoding/ tests"
1ce9585a "Clear-Site-Data must uncontrol affected service worker clients"
ea6dba31 "Align <pattern> and <*Gradient> attribute collection"
7d52b1d5 "[v8][wasm] Fix WebAssembly streaming tests"


Note to sheriffs: This CL imports external tests and adds
expectations for those tests; if this CL is large and causes
a few new failures, please fix the failures by adding new
lines to TestExpectations rather than reverting. See:
https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md

NOAUTOREVERT=true
TBR=raphael.kubo.da.costa

No-Export: true
Change-Id: I8f859fac76aadf3ccc67eb3e37bbd90da677dcab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2071075Reviewed-by: default avatarWPT Autoroller <wpt-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: WPT Autoroller <wpt-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#744136}
parent 00ad99f4
......@@ -21,7 +21,7 @@ PASS CSSStyleSheet.replaceSync throws exception when there is import rule inside
PASS Inserting an @import rule through insertRule on a constructed stylesheet throws an exception
PASS CSSStyleSheet.replaceSync should not trigger any loads from @import rules
PASS CSSStyleSheet.replace allows import rule inside
PASS CSSStyleSheet.replace returns rejected promise on failed imports
FAIL CSSStyleSheet.replace returns rejected promise on failed imports assert_equals: expected "NetworkError" but got "NotAllowedError"
PASS Cloning a shadow host will not clone shadow root, and also adoptedStyleSheets
PASS Importing a shadow host will not copy shadow root, and also adoptedStyleSheets
PASS Adopting a shadow host will empty adoptedStyleSheets if adopting to a different document
......
......@@ -120,7 +120,7 @@ function createAllSheetsPromise() {
const greenSheet = new CSSStyleSheet();
const redSheet = new CSSStyleSheet({media: "screen, print"});
const blueSheet = new CSSStyleSheet({title: "Blue", disabled: true});
const whiteSheet = new CSSStyleSheet({title: "White", alternate: true});
const whiteSheet = new CSSStyleSheet({title: "White", disabled: true});
const yellowSheet = new CSSStyleSheet({disabled: false});
const greenPromise = greenSheet.replace(greenStyleText);
......@@ -140,16 +140,17 @@ promise_test(() => {
const yellowStyleSheet = values[4];
// Lists of style sheets can be created, assigned and read.
// disabled stylesheets aren't applied
document.adoptedStyleSheets = [whiteStyleSheet];
// alternate stylesheets aren't applied when title != current preferable name
assert_equals(getComputedStyle(greenSpan).color, "rgb(0, 0, 0)");
assert_equals(getComputedStyle(redSpan).color, "rgb(0, 0, 0)");
assert_equals(getComputedStyle(blueSpan).color, "rgb(0, 0, 0)");
assert_equals(getComputedStyle(whiteSpan).color, "rgb(0, 0, 0)");
assert_equals(getComputedStyle(yellowSpan).color, "rgb(0, 0, 0)");
// disable dsheets don't block other styles from applying
document.adoptedStyleSheets = [greenStyleSheet, blueStyleSheet];
// disabled stylesheets aren't applied
assert_equals(getComputedStyle(greenSpan).color, "rgb(0, 128, 0)");
assert_equals(getComputedStyle(redSpan).color, "rgb(0, 0, 0)");
assert_equals(getComputedStyle(blueSpan).color, "rgb(0, 0, 0)");
......@@ -170,6 +171,7 @@ promise_test(() => {
assert_equals(getComputedStyle(blueSpan).color, "rgb(0, 0, 0)");
assert_equals(getComputedStyle(whiteSpan).color, "rgb(255, 0, 0)");
assert_equals(getComputedStyle(yellowSpan).color, "rgb(255, 255, 0)");
document.adoptedStyleSheets = [];
});
}, 'Constructed style sheets can be applied on document');
......@@ -241,7 +243,6 @@ test(() => {
}, 'Attaching a shadow root that already has adopted stylesheets work');
test(() => {
const sheet = new CSSStyleSheet();
sheet.replaceSync(":host([red]) { color: red; } :host(.blue) { color: blue; }");
const host = document.createElement("div");
......@@ -327,7 +328,8 @@ promise_test(() => {
assert_equals(getComputedStyle(blueShadowSpan).color, "rgb(0, 0, 0)");
assert_equals(getComputedStyle(whiteShadowSpan).color, "rgb(255, 0, 0)");
assert_equals(getComputedStyle(yellowShadowSpan).color, "rgb(0, 0, 0)");
});
document.adoptedStyleSheets = [];
});
}, 'Constructed stylesheet can be used and modified in multiple TreeScopes');
promise_test(() => {
......@@ -371,9 +373,11 @@ promise_test(() => {
});
}, 'Stylesheets constructed on the main Document cannot be used in iframes');
promise_test(() => {
promise_test(async () => {
const iframe = document.createElement("iframe");
const iframeLoaded = new Promise(resolve => iframe.addEventListener("load", resolve));
document.body.appendChild(iframe);
await iframeLoaded;
const thirdDiv = firstDiv.cloneNode(true);
iframe.contentDocument.body.appendChild(thirdDiv);
const greenIframeSpan = thirdDiv.children[0];
......@@ -629,14 +633,19 @@ promise_test(() => {
assert_equals(sheet.cssRules.length, 1);
assert_equals(sheet.cssRules[0].cssText, import_text);
assert_equals(getComputedStyle(shadowDiv).color, "rgb(255, 0, 0)");
}).catch((reason) => {
assert_unreached(`Promise was rejected (${reason}) when it should have been resolved`);
});
}, 'CSSStyleSheet.replace allows import rule inside');
promise_test(() => {
const sheet = new CSSStyleSheet();
const sheet_promise = sheet.replace("import url('not-there.css');");
return sheet_promise.catch((reason) => {
assert_equals(reason.name, "NotAllowedError");
const sheet_promise = sheet.replace("@import url('not-there.css');");
return sheet_promise.then((sheet) => {
assert_unreached("Promise was resolved when it should have been rejected");
}).catch((reason) => {
assert_equals(reason.name, "NetworkError");
});
}, 'CSSStyleSheet.replace returns rejected promise on failed imports');
......
......@@ -4,6 +4,7 @@
<script>
promise_test(async (t) => {
assert_precondition("HTMLPortalElement" in self);
let hostWindow = window.open();
assert_equals(hostWindow.location.href, "about:blank");
......
......@@ -6,6 +6,7 @@
</body>
<script>
async_test(function(t) {
assert_precondition("HTMLPortalElement" in self);
var w = window.open("resources/frame-src.sub.html?frame_src_policy=%27none%27");
w.onload = function() {
w.document.addEventListener("securitypolicyviolation",
......@@ -20,6 +21,7 @@
}, "Tests that a portal can't be loaded when it violates frame-src");
async_test(function(t) {
assert_precondition("HTMLPortalElement" in self);
var w = window.open(`resources/frame-src.sub.html?frame_src_policy=http://{{hosts[][www]}}:{{ports[http][0]}}`);
w.onload = function() {
w.document.onsecuritypolicyviolation = t.unreached_func("Portal should load.");
......@@ -30,7 +32,7 @@
}
}, "Tests that a portal can be loaded when the origin matches the frame-src CSP header.");
async_test(function(t) {
assert_precondition("HTMLPortalElement" in self);
var w = window.open(`resources/frame-src.sub.html?frame_src_policy=http://{{hosts[][www]}}:{{ports[http][0]}}`);
w.onload = function() {
var portal = w.document.createElement("portal");
......
......@@ -16,36 +16,42 @@
}
promise_test(async () => {
assert_precondition("HTMLPortalElement" in self);
assertInitialHistoryState();
await runTestInPortal(portalSrc, 'testHistoryPushStateInPortal');
assertInitialHistoryState();
}, 'history.pushState navigates independently with replacement in a portal');
promise_test(async () => {
assert_precondition("HTMLPortalElement" in self);
assertInitialHistoryState();
await runTestInPortal(portalSrc, 'testHistoryReplaceStateInPortal');
assertInitialHistoryState();
}, 'history.replaceState navigates independently in a portal');
promise_test(async () => {
assert_precondition("HTMLPortalElement" in self);
assertInitialHistoryState();
await runTestInPortal(portalSrc, 'testLocationAssignInPortal');
assertInitialHistoryState();
}, 'location.assign navigates independently with replacement in a portal');
promise_test(async () => {
assert_precondition("HTMLPortalElement" in self);
assertInitialHistoryState();
await runTestInPortal(portalSrc, 'testLocationReplaceInPortal');
assertInitialHistoryState();
}, 'location.replace navigates independently in a portal');
promise_test(async () => {
assert_precondition("HTMLPortalElement" in self);
assertInitialHistoryState();
await runTestInPortal(portalSrc, 'testSetLocationHrefInPortal');
assertInitialHistoryState();
}, 'Setting location.href navigates independently with replacement in a portal');
promise_test(async () => {
assert_precondition("HTMLPortalElement" in self);
assertInitialHistoryState();
await runTestInPortal(portalSrc, 'testSyntheticAnchorClickInPortal');
assertInitialHistoryState();
......
......@@ -7,6 +7,7 @@
let eventNames = ["load", "message", "messageerror"];
test(() => {
try {
assert_precondition("HTMLPortalElement" in self);
let portal = document.createElement("portal");
for (let eventName of eventNames) {
window.testValue = "not fired";
......
......@@ -13,6 +13,7 @@ function nextMessage(target) {
}
async function openPortalAndActivate(logic, activateOptions) {
assert_precondition("HTMLPortalElement" in self);
const w = await openBlankPortalHost();
try {
const portal = w.document.createElement('portal');
......
......@@ -4,6 +4,7 @@
<script src="/resources/testharnessreport.js"></script>
<script>
async_test(function(t) {
assert_precondition("HTMLPortalElement" in self);
let test = "eventlistener";
var bc = new BroadcastChannel(`test-${test}`);
bc.onmessage = t.step_func_done(function(e) {
......@@ -15,6 +16,7 @@
}, "Tests that the PortalActivateEvent is dispatched when a portal is activated.");
async_test(function(t) {
assert_precondition("HTMLPortalElement" in self);
let test = "eventhandler";
var bc = new BroadcastChannel(`test-${test}`);
bc.onmessage = t.step_func_done(function(e) {
......@@ -26,6 +28,7 @@
}, "Tests that the portalactivate event handler is dispatched when a portal is activated.");
async_test(function(t) {
assert_precondition("HTMLPortalElement" in self);
let test = "bodyeventhandler";
var bc = new BroadcastChannel(`test-${test}`);
bc.onmessage = t.step_func_done(function(e) {
......
......@@ -5,6 +5,7 @@
<body>
<script>
async_test(t => {
assert_precondition("HTMLPortalElement" in self);
var portal = document.createElement("portal");
portal.src = "data:text/html,empty portal";
portal.onload = t.unreached_func("Portal loaded data URL.");
......@@ -13,6 +14,7 @@ async_test(t => {
}, "Tests that a portal can't navigate to a data URL.");
async_test(t => {
assert_precondition("HTMLPortalElement" in self);
var portal = document.createElement("portal");
portal.src = "about:blank";
portal.onload = t.unreached_func("Portal loaded about:blank.");
......@@ -21,6 +23,7 @@ async_test(t => {
}, "Tests that a portal can't navigate to about:blank.");
async_test(t => {
assert_precondition("HTMLPortalElement" in self);
var portal = document.createElement("portal");
portal.src = "resources/simple-portal.html";
portal.onload = t.step_func(() => {
......
......@@ -4,6 +4,7 @@
<script src="/resources/testharnessreport.js"></script>
<script>
async_test(function(t) {
assert_precondition("HTMLPortalElement" in self);
var w = window.open("resources/simple-portal.html");
w.onload = function() {
var portal = w.document.createElement("portal");
......
......@@ -4,6 +4,7 @@
<body>
<script>
promise_test(async t => {
assert_precondition("HTMLPortalElement" in self);
let portal = document.createElement('portal');
document.body.appendChild(portal);
t.add_cleanup(() => { document.body.removeChild(portal); });
......@@ -12,6 +13,7 @@ promise_test(async t => {
}, "A portal that has never been navigated cannot be activated");
promise_test(async t => {
assert_precondition("HTMLPortalElement" in self);
let portal = document.createElement('portal');
document.body.appendChild(portal);
t.add_cleanup(() => { document.body.removeChild(portal); });
......
......@@ -4,6 +4,7 @@
<body>
<script>
promise_test(async t => {
assert_precondition("HTMLPortalElement" in self);
var iframe = document.createElement("iframe");
iframe.src = "resources/portal-inside-iframe.html"
var waitForLoad = new Promise((resolve, reject) => {
......
......@@ -4,6 +4,7 @@
<body>
<script>
promise_test(async () => {
assert_precondition("HTMLPortalElement" in self);
var portal = document.createElement("portal");
portal.src = "resources/portal-activate-inside-portal.html";
let waitForMessage = new Promise((resolve, reject) => {
......
......@@ -3,6 +3,7 @@
<script src="/resources/testharnessreport.js"></script>
<script>
promise_test(async t => {
assert_precondition("HTMLPortalElement" in self);
let activatePromise = document.createElement('portal').activate();
await promise_rejects_dom(t, 'InvalidStateError', activatePromise);
}, "A portal with nothing in it cannot be activated");
......
......@@ -4,6 +4,7 @@
<script src="resources/open-blank-host.js"></script>
<script>
promise_test(async () => {
assert_precondition("HTMLPortalElement" in self);
var win = await openBlankPortalHost();
var portal = win.document.createElement("portal");
portal.src = new URL("resources/simple-portal.html", location.href)
......
......@@ -3,6 +3,7 @@
<script src="/resources/testharnessreport.js"></script>
<script>
promise_test(async t => {
assert_precondition("HTMLPortalElement" in self);
let waitForMessage = new Promise((resolve, reject) => {
window.onmessage = e => resolve(e.data);
});
......@@ -12,6 +13,7 @@ promise_test(async t => {
}, "Calling activate when a portal is already activating should fail");
promise_test(async t => {
assert_precondition("HTMLPortalElement" in self);
let waitForMessage = new Promise((resolve, reject) => {
window.onmessage = e => resolve(e.data);
});
......
......@@ -13,6 +13,7 @@
}
promise_test(async () => {
assert_precondition("HTMLPortalElement" in self);
var test = "adopt-once";
window.open(`resources/portals-adopt-predecessor.html?test=${test}`);
var message = await waitForCompletion(test);
......@@ -20,6 +21,7 @@
}, "Tests that a portal can adopt its predecessor.");
promise_test(async () => {
assert_precondition("HTMLPortalElement" in self);
var test = "adopt-twice";
window.open(`resources/portals-adopt-predecessor.html?test=${test}`);
var message = await waitForCompletion(test);
......@@ -27,6 +29,7 @@
}, "Tests that trying to adopt the predecessor twice will throw an exception.");
async_test(function(t) {
assert_precondition("HTMLPortalElement" in self);
var test = "adopt-after-event";
var bc = new BroadcastChannel(`test-${test}`);
bc.onmessage = t.step_func_done(function(e) {
......@@ -37,6 +40,7 @@
}, "Tests that trying to adopt the predecessor after the PortalActivateEvent will throw an exception.");
promise_test(async t => {
assert_precondition("HTMLPortalElement" in self);
var test = "adopt-and-activate";
window.open(`resources/portals-adopt-predecessor.html?test=${test}`);
var message = await waitForCompletion(test);
......@@ -44,6 +48,7 @@
}, "Tests that activating an adopted predecessor without inserting it works");
async_test(t => {
assert_precondition("HTMLPortalElement" in self);
var test = "adopt-attach-remove";
var bc = new BroadcastChannel(`test-${test}`);
bc.onmessage = t.step_func_done(function(e) {
......@@ -54,6 +59,7 @@
}, "Tests that an adopting, inserting and then removing a predecessor works correctly");
async_test(t => {
assert_precondition("HTMLPortalElement" in self);
var test = "adopt-and-discard";
var bc = new BroadcastChannel(`test-${test}`);
bc.onmessage = t.step_func_done(function(e) {
......@@ -64,6 +70,7 @@
}, "Tests that the adopted predecessor is destroyed if it isn't inserted");
async_test(t => {
assert_precondition("HTMLPortalElement" in self);
var test = "adopt-to-disconnected-node";
var bc = new BroadcastChannel(`test-${test}`);
bc.onmessage = t.step_func_done(function(e) {
......
......@@ -4,6 +4,7 @@
<body>
<script>
promise_test(async () => {
assert_precondition("HTMLPortalElement" in self);
var portal = document.createElement("portal");
portal.src = "http://{{hosts[alt][www]}}:{{ports[http][0]}}/portals/resources/simple-portal.html";
return new Promise((resolve, reject) => {
......
......@@ -8,6 +8,7 @@
<body>
<script>
async function createPortal(doc, url) {
assert_precondition("HTMLPortalElement" in self);
let portal = doc.createElement("portal");
portal.src = url;
doc.body.appendChild(portal);
......
......@@ -4,6 +4,7 @@
<body>
<script>
function openPortalAndReceiveMessage(portalSrc) {
assert_precondition("HTMLPortalElement" in self);
let portal = document.createElement('portal');
portal.src = portalSrc;
let received = new Promise((resolve, reject) => {
......
......@@ -19,6 +19,7 @@
}
promise_test(async () => {
assert_precondition("HTMLPortalElement" in self);
const portalUrl = encodeURIComponent("portal-host-hidden-after-activation-portal.html");
window.open(`resources/portal-embed-and-activate.html?url=${portalUrl}`);
var results = await waitForMessages();
......
......@@ -17,6 +17,7 @@
}
async function createPortalAndLoopMessage(portalSrc, params) {
assert_precondition("HTMLPortalElement" in self);
var portal = await createPortal(portalSrc);
var waitForResponse = new Promise((resolve, reject) => {
portal.addEventListener("message", e => { resolve(e); });
......@@ -72,6 +73,7 @@
}, "postMessage with object message");
promise_test(async () => {
assert_precondition("HTMLPortalElement" in self);
function checkPort(port) {
return new Promise((resolve, reject) => {
var channel = new MessageChannel();
......@@ -136,6 +138,7 @@
}, "postMessage with invalid transferable should throw error");
promise_test(async () => {
assert_precondition("HTMLPortalElement" in self);
var receiveMessage = new Promise((resolve, reject) => {
var bc = new BroadcastChannel("portal-host-post-message-after-activate");
bc.onmessage = e => { resolve(e); };
......@@ -148,6 +151,7 @@
}, "Calling postMessage after receiving onactivate event should fail");
promise_test(() => {
assert_precondition("HTMLPortalElement" in self);
var portal = document.createElement("portal");
portal.src = "resources/portal-host-post-message-navigate-1.html";
var count = 0;
......
......@@ -27,6 +27,7 @@ async function openPortalAndActivate(logic) {
}
promise_test(async () => {
assert_precondition("HTMLPortalElement" in self);
let messageFromNewSrc = await openPortalAndActivate(
'let predecessor = event.adoptPredecessor();' +
'let readyPromise = new Promise((resolve, reject) => {' +
......
......@@ -4,6 +4,7 @@
<body>
<script>
promise_test(() => {
assert_precondition("HTMLPortalElement" in self);
var portal = document.createElement("portal");
portal.src = "resources/portals-nested-portal.html";
document.body.appendChild(portal);
......
......@@ -12,6 +12,7 @@
const crossOriginUrl = "http://{{hosts[alt][www]}}:{{ports[http][0]}}/portals/resources/portal-post-message-portal.html"
async function createAndInsertPortal(portalSrc) {
assert_precondition("HTMLPortalElement" in self);
var portal = document.createElement("portal");
portal.src = portalSrc;
document.body.append(portal);
......@@ -184,6 +185,7 @@
}
promise_test(async t => {
assert_precondition("HTMLPortalElement" in self);
window.open("resources/portal-post-message-before-activate-window.html");
let {postMessageTS, activateTS} = await waitForMessage(
"portals-post-message-before-activate");
......@@ -191,12 +193,14 @@
}, "postMessage before activate should work and preserve order");
promise_test(async t => {
assert_precondition("HTMLPortalElement" in self);
window.open("resources/portal-post-message-during-activate-window.html");
let error = await waitForMessage("portals-post-message-during-activate");
assert_equals(error, "InvalidStateError");
}, "postMessage during activate throws error");
promise_test(async t => {
assert_precondition("HTMLPortalElement" in self);
window.open("resources/portal-post-message-after-activate-window.html");
let error = await waitForMessage("portals-post-message-after-activate");
assert_equals(error, "InvalidStateError");
......
......@@ -4,7 +4,7 @@
<body>
<script>
promise_test(async () => {
assert_true('HTMLPortalElement' in self, 'HTMLPortalElement is required for this test');
assert_precondition('HTMLPortalElement' in self, 'HTMLPortalElement is required for this test');
let portal = document.createElement('portal');
let referrerPromise = new Promise((resolve, reject) => {
portal.addEventListener('message', e => resolve(e.data), {once: true});
......
......@@ -5,7 +5,7 @@
<body>
<script>
promise_test(async () => {
assert_true('HTMLPortalElement' in self, 'HTMLPortalElement is required for this test');
assert_precondition('HTMLPortalElement' in self, 'HTMLPortalElement is required for this test');
let portal = document.createElement('portal');
let referrerPromise = new Promise((resolve, reject) => {
portal.addEventListener('message', e => resolve(e.data), {once: true});
......
......@@ -4,7 +4,7 @@
<body>
<script>
promise_test(async () => {
assert_true('HTMLPortalElement' in self, 'HTMLPortalElement is required for this test');
assert_precondition('HTMLPortalElement' in self, 'HTMLPortalElement is required for this test');
let portal = document.createElement('portal');
let referrerPromise = new Promise((resolve, reject) => {
portal.addEventListener('message', e => resolve(e.data), {once: true});
......@@ -21,7 +21,7 @@ promise_test(async () => {
}, "portal contents should be loaded with referrer");
promise_test(async () => {
assert_true('HTMLPortalElement' in self, 'HTMLPortalElement is required for this test');
assert_precondition('HTMLPortalElement' in self, 'HTMLPortalElement is required for this test');
let portal = document.createElement('portal');
portal.referrerPolicy = 'no-referrer';
let referrerPromise = new Promise((resolve, reject) => {
......@@ -39,7 +39,7 @@ promise_test(async () => {
}, "portal contents should be loaded with no referrer if referrerpolicy=no-referrer");
promise_test(async () => {
assert_true('HTMLPortalElement' in self, 'HTMLPortalElement is required for this test');
assert_precondition('HTMLPortalElement' in self, 'HTMLPortalElement is required for this test');
let portal = document.createElement('portal');
portal.referrerPolicy = 'origin';
let referrerPromise = new Promise((resolve, reject) => {
......
......@@ -2,8 +2,12 @@
<html class="reftest-wait">
<title>Portals rendering test</title>
<link rel="match" href="references/portals-rendering.html">
<body>
<script>
<body></body>
<script>
if (!("HTMLPortalElement" in self)) {
document.body.textContent = "PRECONDITION FAILED";
document.documentElement.classList.remove('reftest-wait');
} else {
var portal = document.createElement('portal');
portal.src = 'resources/portals-rendering-portal.html';
portal.style = 'background-color: red; width: 100px; height: 100px';
......@@ -11,7 +15,8 @@
window.requestAnimationFrame(function(ts) {
document.documentElement.classList.remove('reftest-wait');
});
}
};
document.body.appendChild(portal);
</script>
</body>
}
</script>
......@@ -2,7 +2,8 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
async_test(async t => {
async_test(t => {
assert_precondition("HTMLPortalElement" in self);
let win = window.open("resources/portal-repeated-activate-window.html");
win.onload = () => win.activate();
window.onmessage = t.step_func_done(() => {});
......
......@@ -10,6 +10,7 @@ function nextMessage(target) {
}
promise_test(async () => {
assert_precondition("HTMLPortalElement" in self);
const w = await openBlankPortalHost();
try {
const portal = w.document.createElement('portal');
......
......@@ -12,6 +12,7 @@ function timePasses(delay) {
}
promise_test(async () => {
assert_precondition("HTMLPortalElement" in self);
const w = await openBlankPortalHost();
try {
const portal = w.document.createElement('portal');
......@@ -29,6 +30,7 @@ promise_test(async () => {
}, "pagehide and unload should fire if the predecessor is not adopted");
promise_test(async () => {
assert_precondition("HTMLPortalElement" in self);
localStorage.setItem('predecessor-fires-unload-events', '');
window.open('resources/predecessor-fires-unload-watch-unload.html', '_blank', 'noopener');
while (localStorage.getItem('predecessor-fires-unload-events') != 'pagehide unload') {
......
......@@ -8,6 +8,7 @@
// completion event.
async_test(t => {
assert_precondition("HTMLPortalElement" in self);
var portal = document.createElement('portal');
portal.src = "/portals/xfo/resources/xfo-deny.asis";
portal.onmessage = t.unreached_func("should not have received a message");
......@@ -17,6 +18,7 @@ async_test(t => {
}, "`XFO: DENY` blocks same-origin portals.");
async_test(t => {
assert_precondition("HTMLPortalElement" in self);
var portal = document.createElement('portal');
portal.src = "http://{{domains[www]}}:{{ports[http][0]}}/portals/xfo/resources/xfo-deny.asis";
portal.onmessage = t.unreached_func("should not have received a message");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment