LayoutTests:
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Mar 2007 09:21:11 +0000 (09:21 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Mar 2007 09:21:11 +0000 (09:21 +0000)
        Reviewed by Ada.

        Added a new test to make sure that eventSender.mouseClick works
        correctly.

        * fast/events/click-count-expected.txt: Added.
        * fast/events/click-count.html: Added.

        Updated results for some tests that depended on the broken version of
        eventSender.mouseClick.

        * fast/events/objc-event-api-expected.txt:
        * fast/forms/focus-selection-input-expected.txt:
        * fast/forms/focus-selection-textarea-expected.txt:

WebKitTools:

        Reviewed by Ada.

        Make eventSender.mouseClick actually send a mouse up event.

        * DumpRenderTree/EventSendingController.m:
        (-[EventSendingController mouseClick]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@20386 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/events/click-count-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/click-count.html [new file with mode: 0644]
LayoutTests/fast/events/objc-event-api-expected.txt
LayoutTests/fast/forms/focus-selection-input-expected.txt
LayoutTests/fast/forms/focus-selection-textarea-expected.txt
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/EventSendingController.m

index a1f12d12eeb0cbb53796ef15701c2a73637a29ea..fca8fbe8edc186bd422e980e394a603e4401e9f8 100644 (file)
@@ -1,3 +1,20 @@
+2007-03-22  Adam Roben  <aroben@apple.com>
+
+        Reviewed by Ada.
+
+        Added a new test to make sure that eventSender.mouseClick works
+        correctly.
+
+        * fast/events/click-count-expected.txt: Added.
+        * fast/events/click-count.html: Added.
+
+        Updated results for some tests that depended on the broken version of
+        eventSender.mouseClick.
+
+        * fast/events/objc-event-api-expected.txt:
+        * fast/forms/focus-selection-input-expected.txt:
+        * fast/forms/focus-selection-textarea-expected.txt:
+
 2007-03-21  Mitz Pettel  <mitz@webkit.org>
 
         Reviewed by Darin.
diff --git a/LayoutTests/fast/events/click-count-expected.txt b/LayoutTests/fast/events/click-count-expected.txt
new file mode 100644 (file)
index 0000000..b627e5f
--- /dev/null
@@ -0,0 +1,57 @@
+Click inside this div
+Clicking 1 times
+[Mouse Down] Button: 0 Click Count: 1
+[Mouse Up] Button: 0 Click Count: 1
+[Mouse Click] Button: 0 Click Count: 1
+Clicking 2 times
+[Mouse Down] Button: 0 Click Count: 1
+[Mouse Up] Button: 0 Click Count: 1
+[Mouse Click] Button: 0 Click Count: 1
+[Mouse Down] Button: 0 Click Count: 2
+[Mouse Up] Button: 0 Click Count: 2
+[Mouse Click] Button: 0 Click Count: 2
+[Mouse Double Click] Button: 0 Click Count: 2
+Clicking 3 times
+[Mouse Down] Button: 0 Click Count: 1
+[Mouse Up] Button: 0 Click Count: 1
+[Mouse Click] Button: 0 Click Count: 1
+[Mouse Down] Button: 0 Click Count: 2
+[Mouse Up] Button: 0 Click Count: 2
+[Mouse Click] Button: 0 Click Count: 2
+[Mouse Double Click] Button: 0 Click Count: 2
+[Mouse Down] Button: 0 Click Count: 3
+[Mouse Up] Button: 0 Click Count: 3
+[Mouse Click] Button: 0 Click Count: 3
+Clicking 4 times
+[Mouse Down] Button: 0 Click Count: 1
+[Mouse Up] Button: 0 Click Count: 1
+[Mouse Click] Button: 0 Click Count: 1
+[Mouse Down] Button: 0 Click Count: 2
+[Mouse Up] Button: 0 Click Count: 2
+[Mouse Click] Button: 0 Click Count: 2
+[Mouse Double Click] Button: 0 Click Count: 2
+[Mouse Down] Button: 0 Click Count: 3
+[Mouse Up] Button: 0 Click Count: 3
+[Mouse Click] Button: 0 Click Count: 3
+[Mouse Down] Button: 0 Click Count: 4
+[Mouse Up] Button: 0 Click Count: 4
+[Mouse Click] Button: 0 Click Count: 4
+Clicking 5 times
+[Mouse Down] Button: 0 Click Count: 1
+[Mouse Up] Button: 0 Click Count: 1
+[Mouse Click] Button: 0 Click Count: 1
+[Mouse Down] Button: 0 Click Count: 2
+[Mouse Up] Button: 0 Click Count: 2
+[Mouse Click] Button: 0 Click Count: 2
+[Mouse Double Click] Button: 0 Click Count: 2
+[Mouse Down] Button: 0 Click Count: 3
+[Mouse Up] Button: 0 Click Count: 3
+[Mouse Click] Button: 0 Click Count: 3
+[Mouse Down] Button: 0 Click Count: 4
+[Mouse Up] Button: 0 Click Count: 4
+[Mouse Click] Button: 0 Click Count: 4
+[Mouse Down] Button: 0 Click Count: 5
+[Mouse Up] Button: 0 Click Count: 5
+[Mouse Click] Button: 0 Click Count: 5
+
+
diff --git a/LayoutTests/fast/events/click-count.html b/LayoutTests/fast/events/click-count.html
new file mode 100644 (file)
index 0000000..2491d54
--- /dev/null
@@ -0,0 +1,62 @@
+<html>
+<head>
+<script>
+function log(string)
+{
+    document.getElementById('output').innerHTML += string;
+}
+
+function mouseDown(evt)
+{
+    log("<span style='color:green'>[Mouse Down]</span> Button: " + evt.button + " Click Count: " + evt.detail + "<br>");
+}
+
+function mouseUp(evt)
+{
+    log("<span style='color:green'>[Mouse Up]</span> Button: " + evt.button + " Click Count: " + evt.detail + "<br>");
+}
+
+function mouseClick(evt)
+{
+    log("<span style='color:green'>[Mouse Click]</span> Button: " + evt.button + " Click Count: " + evt.detail + "<br>");
+}
+
+function mouseDoubleClick(evt)
+{
+    log("<span style='color:green'>[Mouse Double Click]</span> Button: " + evt.button + " Click Count: " + evt.detail + "<br>");
+}
+
+function test()
+{
+    if (window.layoutTestController) {
+        layoutTestController.dumpAsText();
+        layoutTestController.waitUntilDone();
+    }
+    if (window.eventSender) {
+        var testEle = document.getElementById("testDiv");
+        eventSender.mouseMoveTo(testEle.offsetLeft+testEle.offsetWidth/2, testEle.offsetTop+testEle.offsetHeight/2);
+        testClick();
+    }
+}
+
+var clickCount = 1;
+function testClick()
+{
+    if (clickCount > 5) {
+        if (window.layoutTestController)
+            layoutTestController.notifyDone();
+        return;
+    }
+    log("Clicking " + clickCount + " times<br>");
+    for (var click = 0; click < clickCount; click++)
+        eventSender.mouseClick();
+    clickCount++;
+    setTimeout(testClick, 1000);
+}
+
+</script>
+</head>
+<body onload="test()">
+<div id="testDiv" style="-webkit-user-select: none; border:1px solid red" onmousedown="mouseDown(event)" onmouseup="mouseUp(event)" onclick="mouseClick(event)" ondblclick="mouseDoubleClick(event)">Click inside this div</div>
+<p id="output">
+</p>
index d39d7ce266277b00fa01671ff42921ef9d2d6e75..82c74b7f8a7d1312f1a072e18730f81dc9238ce8 100644 (file)
@@ -195,6 +195,58 @@ event type:      selectstart
   eventPhase:    3
   bubbles:       1
   cancelable:    1
+event type:      mouseup
+  target:        <div>
+  eventPhase:    3
+  bubbles:       1
+  cancelable:    1
+  detail:        2
+  view:          OK (document: OK)
+  button:        0
+  clientX:       400
+  clientY:       150
+  screenX:       -9600
+  screenY:       -9850
+  modifier keys: c:0 s:0 a:0 m:0
+event type:      click
+  target:        <div>
+  eventPhase:    3
+  bubbles:       1
+  cancelable:    1
+  detail:        2
+  view:          OK (document: OK)
+  button:        0
+  clientX:       400
+  clientY:       150
+  screenX:       -9600
+  screenY:       -9850
+  modifier keys: c:0 s:0 a:0 m:0
+event type:      dblclick
+  target:        <div>
+  eventPhase:    3
+  bubbles:       1
+  cancelable:    1
+  detail:        2
+  view:          OK (document: OK)
+  button:        0
+  clientX:       400
+  clientY:       150
+  screenX:       -9600
+  screenY:       -9850
+  modifier keys: c:0 s:0 a:0 m:0
+event type:      mousemove
+  target:        <div>
+  eventPhase:    3
+  bubbles:       1
+  cancelable:    0
+  detail:        0
+  view:          OK (document: OK)
+  button:        0
+  clientX:       400
+  clientY:       150
+  screenX:       -9600
+  screenY:       -9850
+  modifier keys: c:0 s:0 a:0 m:0
 event type:      mousedown
   target:        <div>
   eventPhase:    3
index 5cb831be76bb410118fd69095d82414b0cb118ed..06473466154579c12c633b4c5f13dea376f6425a 100644 (file)
@@ -24,6 +24,9 @@ EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 <input type="text"> focus selection
 
 This test checks whether the selection is restored, cleared, or set to the full range when using different ways to focus a text field. These results all match Mozilla, except test 6, which selects the whole field contents to match all other cases of keyboard focus. When running manually, please follow the steps below. In the test harness, the test runs automatically.
index fa4d9eb20a7b1a763aab987ce1ad59eac087a31b..fc64f5d80e37b3f032e0f8ecb39344a102e3372c 100644 (file)
@@ -17,6 +17,8 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 <textarea> focus selection
 
 This test checks whether the selection is restored, cleared, or set to the full range when using different ways to focus a text area. These results all match Mozilla. When running manually, please follow the steps below. In the test harness, the test runs automatically.
index 3fcbcf262aac316a62e921269a0a780198327c52..aac305854a81978d853f386292a4f89c57a8afb9 100644 (file)
@@ -1,3 +1,12 @@
+2007-03-22  Adam Roben  <aroben@apple.com>
+
+        Reviewed by Ada.
+
+        Make eventSender.mouseClick actually send a mouse up event.
+
+        * DumpRenderTree/EventSendingController.m:
+        (-[EventSendingController mouseClick]):
+
 2007-03-19  David Hyatt  <hyatt@apple.com>
 
         Update the minimum font size pref to match the actual default setting in Safari.  It should have been 1
index e9935774414d0d8cb27174e4bd4d28829f1be47b..c930a9df97616297a9be3dbf0f7c263c701cdbfb 100644 (file)
@@ -318,8 +318,8 @@ BOOL replayingSavedEvents;
                                                 eventNumber:++eventNumber
                                                  clickCount:clickCount
                                                    pressure:0.0];
-        [NSApp postEvent:mouseUpEvent atStart:NO];
         [subView mouseDown:mouseDownEvent];
+        [subView mouseUp:mouseUpEvent];
         lastClick = [mouseUpEvent timestamp];
     }
 }