forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only allow downloading in response to real keyboard modifiers
BUG=848531 Change-Id: I97554c8d312243b55647f1376945aee32dbd95bf Reviewed-on: https://chromium-review.googlesource.com/1082216 Reviewed-by: Mike West <mkwst@chromium.org> Commit-Queue: Jochen Eisinger <jochen@chromium.org> Cr-Commit-Position: refs/heads/master@{#564051}
- Loading branch information
Showing
7 changed files
with
102 additions
and
30 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
third_party/WebKit/LayoutTests/fast/events/download-on-alt-click-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,4 @@ | ||
Download started | ||
Tests that hitting alt-click results in downloading link. Test passes if a download is observed. | ||
|
||
link |
20 changes: 20 additions & 0 deletions
20
third_party/WebKit/LayoutTests/fast/events/download-on-alt-click.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,20 @@ | ||
<!doctype html> | ||
<script> | ||
function test() | ||
{ | ||
if (window.testRunner) { | ||
testRunner.dumpAsText(); | ||
testRunner.waitUntilDone(); | ||
testRunner.waitUntilExternalURLLoad(); | ||
|
||
var a = document.querySelector("#link"); | ||
eventSender.mouseMoveTo(a.offsetLeft + 10, a.offsetTop + 10); | ||
eventSender.mouseDown(0, ['altKey']); | ||
eventSender.mouseUp(0, ['altKey']); | ||
} | ||
} | ||
</script> | ||
<body onload="test()"> | ||
<p>Tests that hitting alt-click results in downloading link. Test passes if a download is observed.</p> | ||
<a href="resources/notify-done.html" id="link">link</a> | ||
</body> |
1 change: 1 addition & 0 deletions
1
third_party/WebKit/LayoutTests/fast/events/download-on-synthesized-alt-click-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 @@ | ||
|
19 changes: 19 additions & 0 deletions
19
third_party/WebKit/LayoutTests/fast/events/download-on-synthesized-alt-click.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,19 @@ | ||
<!doctype html> | ||
<script> | ||
function test() | ||
{ | ||
if (window.testRunner) { | ||
testRunner.dumpAsText(); | ||
testRunner.waitUntilDone(); | ||
testRunner.waitUntilExternalURLLoad(); | ||
|
||
var a = document.querySelector("#link"); | ||
var evt = new MouseEvent("click", { altKey: true }); | ||
a.dispatchEvent(evt); | ||
} | ||
} | ||
</script> | ||
<body onload="test()"> | ||
<p>Tests that synthesizing alt-click does not result in downloading link. Test passes if no download is observed.</p> | ||
<a href="resources/notify-done.html" id="link">link</a> | ||
</body> |
5 changes: 5 additions & 0 deletions
5
third_party/WebKit/LayoutTests/fast/events/resources/notify-done.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,5 @@ | ||
<!doctype html> | ||
<script> | ||
if (window.testRunner) | ||
testRunner.notifyDone(); | ||
</script> |
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