Changeset 66828 in webkit
- Timestamp:
- Sep 6, 2010 7:42:38 AM (14 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r66827 r66828 1 2010-09-06 Martin Robinson <mrobinson@igalia.com> 2 3 Reviewed by Antonio Gomes. 4 5 Convert editing/selection/shift-click.html to use setEditingBehavior 6 https://bugs.webkit.org/show_bug.cgi?id=45233 7 8 * editing/selection/script-tests/shift-click.js: 9 (shiftClick): Take only one expected string. 10 (assertSelectionString): Take only one expected string. 11 (runShiftClickTest): Added. Runs the test with a particular editing behavior. 12 * editing/selection/shift-click-expected.txt: Updated to reflect new results. 13 * platform/win/editing/selection/shift-click-expected.txt: Removed. 14 1 15 2010-09-06 Xan Lopez <xlopez@igalia.com> 2 16 -
trunk/LayoutTests/editing/selection/script-tests/shift-click.js
r58892 r66828 12 12 var end = document.getElementById('end'); 13 13 14 function shiftClick(x, y, macExpected, otherExpected)14 function shiftClick(x, y, expected) 15 15 { 16 16 eventSender.mouseMoveTo(x, y); 17 17 eventSender.mouseDown(0, ['shiftKey']); 18 18 eventSender.mouseUp(0, ['shiftKey']); 19 assertSelectionString( macExpected, otherExpected);19 assertSelectionString(expected); 20 20 } 21 21 22 var onMac = navigator.userAgent.search(/\bMac OS X\b/) != -1; 23 24 function assertSelectionString(macExpected, otherExpected) 22 function assertSelectionString(expected) 25 23 { 26 var expected = onMac ? macExpected : otherExpected;27 24 if (window.getSelection().toString() == expected) 28 25 testPassed('window.getSelection().toString() is correct'); … … 46 43 } 47 44 48 // Double-click select to get around eventSender bug where it won't select 49 // text just using single-click. 50 if (window.eventSender) { 45 function runShiftClickTest(editingBehavior) 46 { 47 layoutTestController.setEditingBehavior(editingBehavior); 48 49 // Double-click select to get around eventSender bug where it won't select 50 // text just using single-click. 51 51 eventSender.mouseMoveTo(start.offsetLeft, start.offsetTop); 52 52 eventSender.mouseDown(); … … 57 57 eventSender.mouseUp(); 58 58 59 assertSelectionString('two three\nfour five' , 'two three\nfour five')59 assertSelectionString('two three\nfour five'); 60 60 assertSelectionOrder('forward'); 61 61 62 shiftClick(second.offsetLeft + second.offsetWidth, second.offsetTop, 'two three\nfour five six' , 'two three\nfour five six');62 shiftClick(second.offsetLeft + second.offsetWidth, second.offsetTop, 'two three\nfour five six'); 63 63 assertSelectionOrder('forward'); 64 65 shiftClick(end.offsetLeft, end.offsetTop, 'two three\nfour five' , 'two three\nfour five');64 65 shiftClick(end.offsetLeft, end.offsetTop, 'two three\nfour five'); 66 66 assertSelectionOrder('forward'); 67 67 … … 69 69 // In the first shiftClick call, the space after five is selected and shouldn't be. 70 70 // In the second shiftClick call, "six" is selected and shouldn't be. 71 shiftClick(first.offsetLeft, first.offsetTop, 'one two three\nfour five', 'one two'); 71 if (editingBehavior == "mac") 72 shiftClick(first.offsetLeft, first.offsetTop, 'one two three\nfour five'); 73 else 74 shiftClick(first.offsetLeft, first.offsetTop, 'one two'); 72 75 assertSelectionOrder('backward'); 73 76 74 shiftClick(start.offsetLeft, start.offsetTop, 'two three\nfour five', 'two'); 77 if (editingBehavior == "mac") 78 shiftClick(start.offsetLeft, start.offsetTop, 'two three\nfour five'); 79 else 80 shiftClick(start.offsetLeft, start.offsetTop, 'two'); 81 75 82 // FIXME: The selection direction is incorrect on Win/Linux here. It should be backward. 76 83 assertSelectionOrder('backward'); 77 84 } 78 85 86 if (window.eventSender) { 87 runShiftClickTest("mac"); 88 runShiftClickTest("win"); 89 } 90 79 91 var successfullyParsed = true; -
trunk/LayoutTests/editing/selection/shift-click-expected.txt
r58892 r66828 18 18 four five" 19 19 PASS Selection direction is correct. 20 PASS window.getSelection().toString() is correct 21 PASS Selection direction is correct. 22 PASS window.getSelection().toString() is correct 23 PASS Selection direction is correct. 24 PASS window.getSelection().toString() is correct 25 PASS Selection direction is correct. 26 PASS window.getSelection().toString() is correct 27 PASS Selection direction is correct. 28 PASS window.getSelection().toString() is correct 29 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] 20 30 PASS successfullyParsed is true 21 31
Note: See TracChangeset
for help on using the changeset viewer.