[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

mrobinson at webkit.org mrobinson at webkit.org
Wed Dec 22 13:03:17 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit d1dcf870ab38bb5358be1bd0b81460262c82daca
Author: mrobinson at webkit.org <mrobinson at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Sep 6 14:42:38 2010 +0000

    2010-09-06  Martin Robinson  <mrobinson at igalia.com>
    
            Reviewed by Antonio Gomes.
    
            Convert editing/selection/shift-click.html to use setEditingBehavior
            https://bugs.webkit.org/show_bug.cgi?id=45233
    
            * editing/selection/script-tests/shift-click.js:
            (shiftClick): Take only one expected string.
            (assertSelectionString): Take only one expected string.
            (runShiftClickTest): Added. Runs the test with a particular editing behavior.
            * editing/selection/shift-click-expected.txt: Updated to reflect new results.
            * platform/win/editing/selection/shift-click-expected.txt: Removed.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66828 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 5fd27a2..b5bbfb0 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2010-09-06  Martin Robinson  <mrobinson at igalia.com>
+
+        Reviewed by Antonio Gomes.
+
+        Convert editing/selection/shift-click.html to use setEditingBehavior
+        https://bugs.webkit.org/show_bug.cgi?id=45233
+
+        * editing/selection/script-tests/shift-click.js:
+        (shiftClick): Take only one expected string.
+        (assertSelectionString): Take only one expected string.
+        (runShiftClickTest): Added. Runs the test with a particular editing behavior.
+        * editing/selection/shift-click-expected.txt: Updated to reflect new results.
+        * platform/win/editing/selection/shift-click-expected.txt: Removed.
+
 2010-09-06  Xan Lopez  <xlopez at igalia.com>
 
         Reviewed by Martin Robinson.
diff --git a/LayoutTests/editing/selection/script-tests/shift-click.js b/LayoutTests/editing/selection/script-tests/shift-click.js
index cde285f..ca49814 100644
--- a/LayoutTests/editing/selection/script-tests/shift-click.js
+++ b/LayoutTests/editing/selection/script-tests/shift-click.js
@@ -11,19 +11,16 @@ document.body.appendChild(second);
 var start = document.getElementById('start');
 var end = document.getElementById('end');
 
-function shiftClick(x, y, macExpected, otherExpected)
+function shiftClick(x, y, expected)
 {
     eventSender.mouseMoveTo(x, y);
     eventSender.mouseDown(0, ['shiftKey']);
     eventSender.mouseUp(0, ['shiftKey']);
-    assertSelectionString(macExpected, otherExpected);
+    assertSelectionString(expected);
 }
 
-var onMac = navigator.userAgent.search(/\bMac OS X\b/) != -1;
-
-function assertSelectionString(macExpected, otherExpected)
+function assertSelectionString(expected)
 {
-    var expected = onMac ? macExpected : otherExpected;
     if (window.getSelection().toString() == expected)
         testPassed('window.getSelection().toString() is correct');
     else
@@ -45,9 +42,12 @@ function assertSelectionOrder(direction)
         testFailed("Selection direction is not correct. Expected a " + direction + " selection." + selectionAsString(sel));
 }
 
-// Double-click select to get around eventSender bug where it won't select
-// text just using single-click.
-if (window.eventSender) {
+function runShiftClickTest(editingBehavior)
+{
+    layoutTestController.setEditingBehavior(editingBehavior);
+
+    // Double-click select to get around eventSender bug where it won't select
+    // text just using single-click.
     eventSender.mouseMoveTo(start.offsetLeft, start.offsetTop);
     eventSender.mouseDown();
     eventSender.mouseUp();
@@ -56,24 +56,36 @@ if (window.eventSender) {
     eventSender.mouseMoveTo(end.offsetLeft, end.offsetTop);
     eventSender.mouseUp();
 
-    assertSelectionString('two three\nfour five', 'two three\nfour five')
+    assertSelectionString('two three\nfour five');
     assertSelectionOrder('forward');
 
-    shiftClick(second.offsetLeft + second.offsetWidth, second.offsetTop, 'two three\nfour five six', 'two three\nfour five six');
+    shiftClick(second.offsetLeft + second.offsetWidth, second.offsetTop, 'two three\nfour five six');
     assertSelectionOrder('forward');
-        
-    shiftClick(end.offsetLeft, end.offsetTop, 'two three\nfour five', 'two three\nfour five');
+
+    shiftClick(end.offsetLeft, end.offsetTop, 'two three\nfour five');
     assertSelectionOrder('forward');
 
     // These two fail on Mac due to https://bugs.webkit.org/show_bug.cgi?id=36256.
     // In the first shiftClick call, the space after five is selected and shouldn't be.
     // In the second shiftClick call, "six" is selected and shouldn't be.
-    shiftClick(first.offsetLeft, first.offsetTop, 'one two three\nfour five', 'one two');
+    if (editingBehavior == "mac")
+        shiftClick(first.offsetLeft, first.offsetTop, 'one two three\nfour five');
+    else
+        shiftClick(first.offsetLeft, first.offsetTop, 'one two');
     assertSelectionOrder('backward');
 
-    shiftClick(start.offsetLeft, start.offsetTop, 'two three\nfour five', 'two');
+    if (editingBehavior == "mac")
+        shiftClick(start.offsetLeft, start.offsetTop, 'two three\nfour five');
+    else
+        shiftClick(start.offsetLeft, start.offsetTop, 'two');
+
     // FIXME: The selection direction is incorrect on Win/Linux here. It should be backward.
     assertSelectionOrder('backward');
 }
 
+if (window.eventSender) {
+    runShiftClickTest("mac");
+    runShiftClickTest("win");
+}
+
 var successfullyParsed = true;
diff --git a/LayoutTests/editing/selection/shift-click-expected.txt b/LayoutTests/editing/selection/shift-click-expected.txt
index aa14c6d..3aa8fc4 100644
--- a/LayoutTests/editing/selection/shift-click-expected.txt
+++ b/LayoutTests/editing/selection/shift-click-expected.txt
@@ -17,6 +17,16 @@ FAIL window.getSelection().toString() is "two three
 four five six" and should be "two three
 four five"
 PASS Selection direction is correct.
+PASS window.getSelection().toString() is correct
+PASS Selection direction is correct.
+PASS window.getSelection().toString() is correct
+PASS Selection direction is correct.
+PASS window.getSelection().toString() is correct
+PASS Selection direction is correct.
+PASS window.getSelection().toString() is correct
+PASS Selection direction is correct.
+PASS window.getSelection().toString() is correct
+FAIL Selection direction is not correct. Expected a backward selection.[anchorNode: [object Text](two three) anchorOffset: 0 focusNode: [object Text](two three) focusOffset: 3 isCollapsed: false]
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/LayoutTests/platform/win/editing/selection/shift-click-expected.txt b/LayoutTests/platform/win/editing/selection/shift-click-expected.txt
deleted file mode 100644
index d1c0850..0000000
--- a/LayoutTests/platform/win/editing/selection/shift-click-expected.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-Tests that shift+clicking does the platform correct behavior.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS window.getSelection().toString() is correct
-PASS Selection direction is correct.
-PASS window.getSelection().toString() is correct
-PASS Selection direction is correct.
-PASS window.getSelection().toString() is correct
-PASS Selection direction is correct.
-PASS window.getSelection().toString() is correct
-PASS Selection direction is correct.
-PASS window.getSelection().toString() is correct
-FAIL Selection direction is not correct. Expected a backward selection.[anchorNode: [object Text](two three) anchorOffset: 0 focusNode: [object Text](two three) focusOffset: 3 isCollapsed: false]
-PASS successfullyParsed is true
-
-TEST COMPLETE
-one two three
-four five six

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list