-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fenced frames: Disable popup navigations after network revocation
Navigations into and out of fenced frames need to be treated specially for network revocation, because they don't have the revoked partition nonce attached. Previous CLs disabled embedder-initiated fenced frame root navigations and _unfencedTop navigations; this CL disables popup navigations. Bug: 1515599 Change-Id: Ia05e3fecb40240de1d32a3e736e42eba5f03f411
- Loading branch information
1 parent
2380ac0
commit 4f644d5
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!DOCTYPE html> | ||
<title>Test that window.fence.disableUntrustedNetwork disables | ||
popup navigations.</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> | ||
<script src="/resources/testdriver.js"></script> | ||
<script src="/resources/testdriver-actions.js"></script> | ||
<script src="/resources/testdriver-vendor.js"></script> | ||
|
||
<body> | ||
<script> | ||
|
||
promise_test(async(t) => { | ||
const fencedframe = await attachFencedFrameContext({generator_api: 'fledge'}); | ||
await fencedframe.execute(() => {}); | ||
|
||
const actions = new test_driver.Actions(); | ||
await actions.setContext(window) | ||
.pointerMove(0, 0, {origin: fencedframe.element}) | ||
.pointerDown() | ||
.pointerUp() | ||
.send(); | ||
|
||
await fencedframe.execute(async () => { | ||
await window.fence.disableUntrustedNetwork(); | ||
// After disabling network, popup navigations should not work. | ||
assert_true(navigator.userActivation.isActive, | ||
'The frame should have user activation.'); | ||
window.popup = attachWindowContext(); | ||
}); | ||
|
||
const result = await Promise.race([ | ||
fencedframe.execute(async () => { | ||
return await window.popup.execute(() => { return 'popup_loaded'; }); | ||
}), | ||
new Promise((resolve) => t.step_timeout( | ||
() => resolve('timeout'), 2000)) | ||
]); | ||
assert_equals(result, 'timeout'); | ||
}, 'window.fence.disableUntrustedNetwork disables popup navigations'); | ||
|
||
</script> | ||
</body> |