Changeset 60693 in webkit


Ignore:
Timestamp:
Jun 4, 2010 12:03:45 PM (14 years ago)
Author:
andersca@apple.com
Message:

2010-06-04 Anders Carlsson <andersca@apple.com>

Reviewed by David Hyatt.

Make the editing/spelling/context-menu-suggestions.html test more robust
https://bugs.webkit.org/show_bug.cgi?id=40178

  • editing/spelling/context-menu-suggestions-expected.txt: Added. Add new expected test result.


  • editing/spelling/context-menu-suggestions.html: Instead of dumping the menu item titles, check the length and check that the number of items is greater when there are spell checker suggestions.
  • platform/mac-leopard/editing/spelling/context-menu-suggestions-expected.txt: Removed.
  • platform/mac-snowleopard/editing/spelling/context-menu-suggestions-expected.txt: Removed.
  • platform/mac-tiger/editing/spelling/context-menu-suggestions-expected.txt: Removed. Remove platform specific versions.

2010-06-04 Anders Carlsson <andersca@apple.com>

Reviewed by David Hyatt.

Make the editing/spelling/context-menu-suggestions.html test more robust
https://bugs.webkit.org/show_bug.cgi?id=40178

Change the contextClick method to return an array of strings describing the context menu items.

  • DumpRenderTree/mac/EventSendingController.mm: (+[EventSendingController isSelectorExcludedFromWebScript:]): (+[EventSendingController webScriptNameForSelector:]): (-[EventSendingController contextClick]):
Location:
trunk
Files:
1 added
3 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r60689 r60693  
     12010-06-04  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by David Hyatt.
     4
     5        Make the editing/spelling/context-menu-suggestions.html test more robust
     6        https://bugs.webkit.org/show_bug.cgi?id=40178
     7
     8        * editing/spelling/context-menu-suggestions-expected.txt: Added.
     9        Add new expected test result.
     10       
     11        * editing/spelling/context-menu-suggestions.html:
     12        Instead of dumping the menu item titles, check the length and check that the number of items is greater when
     13        there are spell checker suggestions.
     14
     15        * platform/mac-leopard/editing/spelling/context-menu-suggestions-expected.txt: Removed.
     16        * platform/mac-snowleopard/editing/spelling/context-menu-suggestions-expected.txt: Removed.
     17        * platform/mac-tiger/editing/spelling/context-menu-suggestions-expected.txt: Removed.
     18        Remove platform specific versions.
     19
    1202010-06-04  Dirk Schulze  <krit@webkit.org>
    221
  • trunk/LayoutTests/editing/spelling/context-menu-suggestions.html

    r59585 r60693  
    33To test manually, right click on the text in the input box.</p>
    44<input id="input" spellcheck="false" />
     5<div id="result">FAIL: Did not run test</div>
    56</body>
    67<script>
     
    1213    var input = document.getElementById("input");
    1314    input.focus();
    14     document.execCommand("InsertText", false, 'w');
    15     document.execCommand("InsertText", false, 'w');
     15    document.execCommand("InsertText", false, 'wellcome');
    1616    document.execCommand("InsertText", false, ' ');
    1717
     
    2222        return;
    2323
    24     console.log("Spelling suggestings should NOT be here");
    2524    eventSender.mouseMoveTo(x, y);
    26     eventSender.contextClick(true);
     25    var itemNamesWithoutSpellChecking = eventSender.contextClick();
    2726
    2827    input.setAttribute("spellcheck", "true");
     28    eventSender.mouseMoveTo(x, y);
    2929
    30     console.log("Spelling suggestings SHOULD be here");
    31     eventSender.mouseMoveTo(x, y);
    32     eventSender.contextClick(true);
     30    var itemNamesWithSpellChecking = eventSender.contextClick();
     31   
     32    if (itemNamesWithSpellChecking.length > itemNamesWithoutSpellChecking.length)
     33        document.getElementById('result').innerHTML = 'SUCCESS';
     34    else
     35        document.getElementById('result').innerHTML = 'FAILURE: No spell checking suggestions';
    3336}
    3437</script>
  • trunk/WebKitTools/ChangeLog

    r60690 r60693  
     12010-06-04  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by David Hyatt.
     4
     5        Make the editing/spelling/context-menu-suggestions.html test more robust
     6        https://bugs.webkit.org/show_bug.cgi?id=40178
     7
     8        Change the contextClick method to return an array of strings describing the context menu items.
     9
     10        * DumpRenderTree/mac/EventSendingController.mm:
     11        (+[EventSendingController isSelectorExcludedFromWebScript:]):
     12        (+[EventSendingController webScriptNameForSelector:]):
     13        (-[EventSendingController contextClick]):
     14
    1152010-06-03  Kinuko Yasuda  <kinuko@chromium.org>
    216
  • trunk/WebKitTools/DumpRenderTree/mac/EventSendingController.mm

    r59586 r60693  
    123123    if (aSelector == @selector(beginDragWithFiles:)
    124124            || aSelector == @selector(clearKillRing)
    125             || aSelector == @selector(contextClick:)
     125            || aSelector == @selector(contextClick)
    126126            || aSelector == @selector(enableDOMUIEventLogging:)
    127127            || aSelector == @selector(fireKeyboardEventsToElement:)
     
    153153    if (aSelector == @selector(beginDragWithFiles:))
    154154        return @"beginDragWithFiles";
    155     if (aSelector == @selector(contextClick:))
     155    if (aSelector == @selector(contextClick))
    156156        return @"contextClick";
    157157    if (aSelector == @selector(enableDOMUIEventLogging:))
     
    495495}
    496496
    497 - (void)contextClick:(BOOL)shouldPrintMenuItems
     497- (NSArray *)contextClick
    498498{
    499499    [[[mainFrame frameView] documentView] layout];
     
    511511
    512512    NSView *subView = [[mainFrame webView] hitTest:[event locationInWindow]];
     513    NSMutableArray *menuItemStrings = [NSMutableArray array];
     514   
    513515    if (subView) {
    514516        NSMenu* menu = [subView menuForEvent:event];
    515         if (shouldPrintMenuItems) {
    516             printf("ContextMenuItems: ");
    517             for (int i = 0; i < [menu numberOfItems]; ++i) {
    518                 NSMenuItem* menuItem = [menu itemAtIndex:i];
    519                 if (!strcmp("Inspect Element", [[menuItem title] UTF8String]))
    520                     continue;
    521                 if (i > 0)
    522                     printf(", ");
    523                 fputs([menuItem isSeparatorItem] ? "<separator>" : [[menuItem title] UTF8String], stdout);
    524             }
    525             printf("\n");
     517
     518        for (int i = 0; i < [menu numberOfItems]; ++i) {
     519            NSMenuItem* menuItem = [menu itemAtIndex:i];
     520            if (!strcmp("Inspect Element", [[menuItem title] UTF8String]))
     521                continue;
     522
     523            if ([menuItem isSeparatorItem])
     524                [menuItemStrings addObject:@"<separator>"];
     525            else
     526                [menuItemStrings addObject:[menuItem title]];
    526527        }
    527528    }
     529   
     530    return menuItemStrings;
    528531}
    529532
Note: See TracChangeset for help on using the changeset viewer.