summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/resources
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/resources')
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/resources/sandbox-top-navigation-helper.sub.js (renamed from testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/resources/sandbox-top-navigation-helper.js)18
1 files changed, 14 insertions, 4 deletions
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/resources/sandbox-top-navigation-helper.js b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/resources/sandbox-top-navigation-helper.sub.js
index 413f392dfc..bec8f6a64a 100644
--- a/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/resources/sandbox-top-navigation-helper.js
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-iframe-element/resources/sandbox-top-navigation-helper.sub.js
@@ -5,7 +5,7 @@
// // META: script=/resources/testdriver.js
// // META: script=/resources/testdriver-vendor.js
// // META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js
-// // META: script=./resources/sandbox-top-navigation-helper.js
+// // META: script=./resources/sandbox-top-navigation-helper.sub.js
// Helper file that provides various functions to test top-level navigation
// with various frame and sandbox flag configurations.
@@ -27,18 +27,28 @@ async function createNestedIframe(parent, origin, frame_sandbox, header_sandbox)
origin: origin,
scripts: [
'/resources/testdriver.js',
- '/resources/testdriver-driver.js',
- '/resources/testdriver-vendor.js'
+ '/resources/testdriver-vendor.js',
],
headers: headers,
}, iframe_attributes);
}
+async function navigateFrameTo(frame, origin) {
+ return frame.navigateToNew({
+ origin: origin,
+ scripts: [
+ '/resources/testdriver.js',
+ '/resources/testdriver-vendor.js',
+ ],
+ });
+}
+
async function attemptTopNavigation(iframe, should_succeed) {
let did_succeed;
try {
await iframe.executeScript(() => {
- window.top.location.href = "https://google.com";
+ window.top.location.href =
+ 'http://{{hosts[alt][www2]}}:{{ports[http][0]}}';
});
did_succeed = true;
} catch (e) {