Changeset 69515 in webkit


Ignore:
Timestamp:
Oct 11, 2010 12:09:53 PM (13 years ago)
Author:
tonikitoo@webkit.org
Message:

2010-10-10 Antonio Gomes <agomes@rim.com>

Reviewed by Andreas Kling.

Convert editing/selection/script-tests/click-in-padding-with-multiple-line-boxes.js to use LayoutTestController::setEditingBehavior
https://bugs.webkit.org/show_bug.cgi?id=47472

Patch converts the editing/selection/click-in-padding-with-multiple-line-boxes.js to make use of the
LayoutTestController::setEditingBehavior machinery. That way, all platform specific editing behavior
code paths can be test in the same execution, and we make it possible to share the same
expected result file through all ports.

  • editing/selection/click-in-padding-with-multiple-line-boxes-expected.txt: Modified with resutls for all editing behaviors, i.e. mac and win.
  • editing/selection/script-tests/click-in-padding-with-multiple-line-boxes.js: ():
  • platform/mac/editing/selection/click-in-padding-with-multiple-line-boxes-expected.txt: Removed.
  • platform/qt/editing/selection/click-in-padding-with-multiple-line-boxes-expected.txt: Removed.
  • platform/win/editing/selection/click-in-padding-with-multiple-line-boxes-expected.txt: Removed.
Location:
trunk/LayoutTests
Files:
3 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r69513 r69515  
     12010-10-10  Antonio Gomes  <agomes@rim.com>
     2
     3        Reviewed by Andreas Kling.
     4
     5        Convert editing/selection/script-tests/click-in-padding-with-multiple-line-boxes.js to use LayoutTestController::setEditingBehavior
     6        https://bugs.webkit.org/show_bug.cgi?id=47472
     7
     8        Patch converts the editing/selection/click-in-padding-with-multiple-line-boxes.js to make use of the
     9        LayoutTestController::setEditingBehavior machinery. That way, all platform specific editing behavior
     10        code paths can be test in the same execution, and we make it possible to share the same
     11        expected result file through all ports.
     12
     13        * editing/selection/click-in-padding-with-multiple-line-boxes-expected.txt: Modified with resutls for all editing behaviors, i.e. mac and win.
     14        * editing/selection/script-tests/click-in-padding-with-multiple-line-boxes.js:
     15        ():
     16        * platform/mac/editing/selection/click-in-padding-with-multiple-line-boxes-expected.txt: Removed.
     17        * platform/qt/editing/selection/click-in-padding-with-multiple-line-boxes-expected.txt: Removed.
     18        * platform/win/editing/selection/click-in-padding-with-multiple-line-boxes-expected.txt: Removed.
     19
    1202010-10-11  Ryosuke Niwa  <rniwa@webkit.org>
    221
  • trunk/LayoutTests/editing/selection/click-in-padding-with-multiple-line-boxes-expected.txt

    r41191 r69515  
    44
    55
    6 PASS Selection is at node: [object Text] offset: 1
    7 PASS Selection is at node: [object Text] offset: 1
     6PASS Selection is [anchorNode: [object Text](12345) anchorOffset: 0 focusNode: [object Text](12345) focusOffset: 0 isCollapsed: true]
     7PASS Selection is [anchorNode: [object Text](BAR) anchorOffset: 3 focusNode: [object Text](BAR) focusOffset: 3 isCollapsed: true]
     8PASS Selection is [anchorNode: [object Text](FOO) anchorOffset: 1 focusNode: [object Text](FOO) focusOffset: 1 isCollapsed: true]
     9PASS Selection is [anchorNode: [object Text](FOO) anchorOffset: 1 focusNode: [object Text](FOO) focusOffset: 1 isCollapsed: true]
    810PASS successfullyParsed is true
    911
  • trunk/LayoutTests/editing/selection/script-tests/click-in-padding-with-multiple-line-boxes.js

    r48549 r69515  
    4848
    4949// The rules for clicking below the text are different on Windows and Mac.
    50 // Later we could break this into two tests, one that tests each platform's rules,
    51 // since this is supported as a setting in the Settings object, but for now, we'll
    52 // just use separate expected results for Mac and other platforms.
    53 var expectMacStyleSelection = navigator.userAgent.search(/\bMac OS X\b/) != -1;
     50function editingTest(editingBehavior)
     51{
     52    if (window.layoutTestController)
     53        layoutTestController.setEditingBehavior(editingBehavior);
     54   
     55    var expectMacStyleSelection = editingBehavior == "mac";
    5456
    55 var foo = document.getElementById('foo');
    56 var x = foo.offsetLeft - div.scrollLeft + 10;
     57    var foo = document.getElementById('foo');
     58    var x = foo.offsetLeft - div.scrollLeft + 10;
    5759
    58 // Click 10px after the start of the span should put the cursor right after the letter F.
    59 if (expectMacStyleSelection) {
    60     clickShouldResultInRange(x, foo.offsetTop - 20, div.firstChild, 0);
    61     clickShouldResultInRange(x, foo.offsetTop + 20, div.lastChild.firstChild, 3);
    62 } else {
    63     clickShouldResultInRange(x, foo.offsetTop - 20, foo.firstChild, 1);
    64     clickShouldResultInRange(x, foo.offsetTop + 20, foo.firstChild, 1);
     60    // Click 10px after the start of the span should put the cursor right after the letter F.
     61    if (expectMacStyleSelection) {
     62        clickShouldResultInRange(x, foo.offsetTop - 20, div.firstChild, 0);
     63        clickShouldResultInRange(x, foo.offsetTop + 20, div.lastChild.firstChild, 3);
     64    } else {
     65        clickShouldResultInRange(x, foo.offsetTop - 20, foo.firstChild, 1);
     66        clickShouldResultInRange(x, foo.offsetTop + 20, foo.firstChild, 1);
     67    }
    6568}
     69
     70editingTest("mac");
     71editingTest("win");
    6672
    6773// Clean up after ourselves if we're not being run in the browser
Note: See TracChangeset for help on using the changeset viewer.