<!DOCTYPE html>
<title>
Test that window.fence.disableUntrustedNetwork disables navigations of
credentialless 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 credentialless_iframe = await attachIFrameContext({
attributes: [['credentialless', true]]
});
return await credentialless_iframe.execute(() => {
return 'nav success';
});
}, []);
const result = await Promise.race([
navigation_promise,
new Promise((r) => t.step_timeout(() => r('timeout'), 2000))
]);
assert_equals(result, 'timeout');
}, 'disableUntrustedNetwork disables FF->credentialless IF navigation');
</script>
</body>