-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Site Isolation] Add a test verifying mouse event handlers are only c…
…alled on the target frame https://bugs.webkit.org/show_bug.cgi?id=264634 rdar://118254156 Reviewed by Alex Christensen. * LayoutTests/http/tests/site-isolation/mouse-events/mainframe-prevent-default-expected.txt: Added. * LayoutTests/http/tests/site-isolation/mouse-events/mainframe-prevent-default.html: Added. Canonical link: https://commits.webkit.org/270580@main
- Loading branch information
1 parent
b3fbb2d
commit 4f24df1
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
LayoutTests/http/tests/site-isolation/mouse-events/mainframe-prevent-default-expected.txt
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,5 @@ | ||
PASS iframe received mouse event. | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
27 changes: 27 additions & 0 deletions
27
LayoutTests/http/tests/site-isolation/mouse-events/mainframe-prevent-default.html
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,27 @@ | ||
<!-- webkit-test-runner [ SiteIsolationEnabled=true ] --> | ||
<script src="/js-test-resources/js-test.js"></script> | ||
<script> | ||
if (window.testRunner) { | ||
window.jsTestIsAsync = true; | ||
testRunner.dumpAsText(); | ||
} | ||
|
||
addEventListener("message", (event) => { | ||
testPassed("iframe received mouse event."); | ||
finishJSTest(); | ||
}); | ||
|
||
addEventListener("mousedown", (event) => { | ||
testFailed("main frame received mouse event."); | ||
event.preventDefault(); | ||
}); | ||
|
||
function onLoad() { | ||
if (window.eventSender) { | ||
eventSender.mouseMoveTo(100, 100); | ||
eventSender.mouseDown(); | ||
eventSender.mouseUp(); | ||
} | ||
} | ||
</script> | ||
<iframe onload="onLoad()" width="500" height="500" src="http://localhost:8000/site-isolation/mouse-events/resources/message-mouse-down-coordinates.html"></iframe> |