summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fenced-frame/resources/navigate-ancestor-helper.https.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/fenced-frame/resources/navigate-ancestor-helper.https.html')
-rw-r--r--testing/web-platform/tests/fenced-frame/resources/navigate-ancestor-helper.https.html33
1 files changed, 33 insertions, 0 deletions
diff --git a/testing/web-platform/tests/fenced-frame/resources/navigate-ancestor-helper.https.html b/testing/web-platform/tests/fenced-frame/resources/navigate-ancestor-helper.https.html
new file mode 100644
index 0000000000..2cd8fcf786
--- /dev/null
+++ b/testing/web-platform/tests/fenced-frame/resources/navigate-ancestor-helper.https.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Navigate ancestor helper</title>
+
+<script src="/resources/testdriver.js"></script>
+<script src="/resources/testdriver-actions.js"></script>
+<script src="/resources/testdriver-vendor.js"></script>
+<script src="utils.js"></script>
+<body>
+<script>
+(async () => {
+ // This document is loaded into either a top-level fenced frame, a nested
+ // fenced frame, or an iframe in a top-level fenced frame. In any case, this
+ // document is always the inner-most document in any test. It navigates an
+ // ancestor frame by clicking the anchor above via script. When this document
+ // is loaded in a fenced frame, the frame that should actually navigate is
+ // this one, since fenced frames are top-level browsing contexts.
+ // When this document is loaded into a top-level fenced frame or a nested
+ // fenced frame, we test that the right frame is navigated in
+ // `navigate-ancestor-test-runner.https.html`. When this document is loaded
+ // into an iframe in a top-level fenced frame, we test that the navigation is
+ // blocked due to the sandbox behavior of fenced frame trees.
+ const [navigate_ancestor_key, ancestor_type] = parseKeylist();
+ const url = generateURL(`navigate-ancestor-destination.https.html`,
+ [navigate_ancestor_key]);
+ await simulateGesture();
+ try {
+ window[ancestor_type].location = url;
+ } catch (e) {
+ window[ancestor_type].postMessage('location change failed.');
+ }
+})();
+</script>
+</body>