forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscrollbar-middleclick-nopaste.html
42 lines (39 loc) · 1.29 KB
/
scrollbar-middleclick-nopaste.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<html>
<body onpaste="pasteCount++;">
<script>
var pasteCount = 0;
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
</script>
<div id="console" style="width:200%;height:200%;">
<div style="border:2px solid black;width:25%;" onclick="finished();"> This test checks that middle clicking the scroll bars doesn't trigger a paste event (See <a href="https://bugs.webkit.org/show_bug.cgi?id=33062">Bug 33062</a>). If the test passes, the output will be a single line that says PASS. To run the tests manually, middle click each of the scroll bars, then click this paragraph.</div>
<input type="text" id="input-field" onpaste="pasteCount++;"/>
</div>
<script>
var i = document.getElementById('input-field');
i.focus();
if (window.eventSender) {
eventSender.mouseMoveTo(window.innerWidth - 1, 1);
eventSender.mouseDown(1);
eventSender.mouseUp(1);
eventSender.mouseMoveTo(1, window.innerHeight - 1);
eventSender.mouseDown(1);
eventSender.mouseUp(1);
finished();
}
function finished()
{
if (pasteCount == 0) {
document.getElementById('console').innerHTML = "PASS";
} else {
document.getElementById('console').innerHTML = "FAIL";
}
if (window.testRunner) {
window.testRunner.notifyDone();
}
}
</script>
</body>
</html>