Commit f492b8dc authored by jwieczorek@webkit.org's avatar jwieczorek@webkit.org

2010-04-03 Jakub Wieczorek <jwieczorek@webkit.org>

        Rubber-stamped by Daniel Bates.

        Fix the fast/events/popup-allowed-from-gesture-initiated-event.html test
        failure on the Qt and GTK+ ports.

        Refactor it to not hardcode any metrics (in order to dispatch mouse events)
        but instead calculate them from the offset* properties.

        * fast/events/popup-allowed-from-gesture-initiated-event.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@57052 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 40e6ef33
2010-04-03 Jakub Wieczorek <jwieczorek@webkit.org>
Rubber-stamped by Daniel Bates.
Fix the fast/events/popup-allowed-from-gesture-initiated-event.html test
failure on the Qt and GTK+ ports.
Refactor it to not hardcode any metrics (in order to dispatch mouse events)
but instead calculate them from the offset* properties.
* fast/events/popup-allowed-from-gesture-initiated-event.html:
2010-04-03 Kenneth Russell <kbr@google.com>
Reviewed by Darin Fisher.
......
......@@ -4,8 +4,8 @@
<script src="../js/resources/js-test-pre.js"></script>
</head>
<body>
<button id="button1" onclick="button1()">Click Here</button>
<button id="button2" onclick="button2()">Click Here Too</button>
<button id="button1" onclick="testButton1()">Click Here</button>
<button id="button2" onclick="testButton2()">Click Here Too</button>
<button id="test" onclick="popup()" style="display:none"></button>
<div id="console"></div>
<script>
......@@ -14,12 +14,12 @@
win = window.open("about:blank", "blank");
shouldBeNonNull("win");
}
function button1() {
function testButton1() {
document.getElementById("test").click();
}
function button2() {
function testButton2() {
var clickEvent = document.createEvent("MouseEvents");
clickEvent.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
document.getElementById("test").dispatchEvent(clickEvent);
......@@ -32,11 +32,14 @@
layoutTestController.setCloseRemainingWindowsWhenComplete(true);
layoutTestController.waitUntilDone();
var button1 = document.getElementById("button1");
var button2 = document.getElementById("button2");
if (window.eventSender) {
eventSender.mouseMoveTo(10, 10);
eventSender.mouseMoveTo(button1.offsetLeft + button1.offsetWidth / 2, button1.offsetTop + button1.offsetHeight / 2);
eventSender.mouseDown();
eventSender.mouseUp();
eventSender.mouseMoveTo(100, 10);
eventSender.mouseMoveTo(button2.offsetLeft + button2.offsetWidth / 2, button2.offsetTop + button2.offsetHeight / 2);
eventSender.mouseDown();
eventSender.mouseUp();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment