summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-sticky-activation-iframe.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-sticky-activation-iframe.html')
-rw-r--r--testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-sticky-activation-iframe.html25
1 files changed, 25 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-sticky-activation-iframe.html b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-sticky-activation-iframe.html
new file mode 100644
index 0000000000..212a10c005
--- /dev/null
+++ b/testing/web-platform/tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-sticky-activation-iframe.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Beforeunload must be gated behind sticky activation: nested browsing context</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<p>If you happen to be running this test as a human, then be sure not to interact with any part of the page; that would invalidate the results!
+
+<script>
+setup({ single_test: true });
+
+const iframe = document.createElement('iframe');
+iframe.src = 'support/beforeunload-sticky-start.html';
+
+window.onmessage = e => {
+ assert_equals(e.data, 'navigated successfully');
+
+ const desiredURL = (new URL('support/beforeunload-sticky-destination.html', location.href)).href;
+ assert_equals(iframe.contentWindow.location.href, desiredURL);
+
+ done();
+};
+
+document.body.append(iframe);
+</script>