<!DOCTYPE html>
<title>Test that window.fence.disableUntrustedNetwork disables
navigations of iframes nested in fenced frames.</title>
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/utils.js"></script>
<script src="/common/dispatcher/dispatcher.js"></script>
<script src="resources/utils.js"></script>
<body>
<script>
promise_test(async(t) => {
const fencedframe = await attachFencedFrameContext();
await fencedframe.execute(async () => {
await window.fence.disableUntrustedNetwork();
});
const navigation_promise =
fencedframe.execute(async () => {
const nested_iframe = await attachIFrameContext();
return nested_iframe.execute(() => { return 'nav success'; }); },
[]);
const result = await Promise.race([
navigation_promise,
new Promise((resolve, reject) => t.step_timeout(
() => resolve('timeout'), 2000))]);
assert_equals(result, 'timeout');
}, 'window.fence.disableUntrustedNetwork disables FF->IF navigation');
</script>
</body>