Commit 87dbb021 authored by andersca@apple.com's avatar andersca@apple.com

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]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@60693 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8fa8410b
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 Dirk Schulze <krit@webkit.org>
Reviewed by Nikolas Zimmermann.
......
This test checks that spelling suggestions in the context menu are not show when spellcheck="false". To test manually, right click on the text in the input box.
SUCCESS
......@@ -2,6 +2,7 @@
<p>This test checks that spelling suggestions in the context menu are not show when spellcheck="false".
To test manually, right click on the text in the input box.</p>
<input id="input" spellcheck="false" />
<div id="result">FAIL: Did not run test</div>
</body>
<script>
function test()
......@@ -11,8 +12,7 @@ function test()
var input = document.getElementById("input");
input.focus();
document.execCommand("InsertText", false, 'w');
document.execCommand("InsertText", false, 'w');
document.execCommand("InsertText", false, 'wellcome');
document.execCommand("InsertText", false, ' ');
var x = input.offsetParent.offsetLeft + input.offsetLeft + 4;
......@@ -21,14 +21,17 @@ function test()
if (!window.eventSender)
return;
console.log("Spelling suggestings should NOT be here");
eventSender.mouseMoveTo(x, y);
eventSender.contextClick(true);
var itemNamesWithoutSpellChecking = eventSender.contextClick();
input.setAttribute("spellcheck", "true");
console.log("Spelling suggestings SHOULD be here");
eventSender.mouseMoveTo(x, y);
eventSender.contextClick(true);
var itemNamesWithSpellChecking = eventSender.contextClick();
if (itemNamesWithSpellChecking.length > itemNamesWithoutSpellChecking.length)
document.getElementById('result').innerHTML = 'SUCCESS';
else
document.getElementById('result').innerHTML = 'FAILURE: No spell checking suggestions';
}
</script>
CONSOLE MESSAGE: line 24: Spelling suggestings should NOT be here
ContextMenuItems: Search in Spotlight, Search in Google, <separator>, Look Up in Dictionary, <separator>, Cut, Copy, Paste, <separator>, Spelling and Grammar, Font, Speech, Writing Direction
CONSOLE MESSAGE: line 30: Spelling suggestings SHOULD be here
ContextMenuItems: wow, <separator>, Ignore Spelling, Learn Spelling, <separator>, Search in Spotlight, Search in Google, <separator>, Look Up in Dictionary, <separator>, Cut, Copy, Paste, <separator>, Spelling and Grammar, Font, Speech, Writing Direction
This test checks that spelling suggestions in the context menu are not show when spellcheck="false". To test manually, right click on the text in the input box.
CONSOLE MESSAGE: line 24: Spelling suggestings should NOT be here
ContextMenuItems: Search in Spotlight, Search in Google, <separator>, Look Up in Dictionary, <separator>, Cut, Copy, Paste, <separator>, Spelling and Grammar, Substitutions, Transformations, Font, Speech, Paragraph Direction
CONSOLE MESSAGE: line 30: Spelling suggestings SHOULD be here
ContextMenuItems: wow, <separator>, Ignore Spelling, Learn Spelling, <separator>, Search in Spotlight, Search in Google, <separator>, Look Up in Dictionary, <separator>, Cut, Copy, Paste, <separator>, Spelling and Grammar, Substitutions, Transformations, Font, Speech, Paragraph Direction
This test checks that spelling suggestions in the context menu are not show when spellcheck="false". To test manually, right click on the text in the input box.
CONSOLE MESSAGE: line 24: Spelling suggestings should NOT be here
ContextMenuItems: Search in Spotlight, Search in Google, <separator>, Look Up in Dictionary, <separator>, Cut, Copy, Paste, <separator>, Spelling, Font, Speech, Writing Direction
CONSOLE MESSAGE: line 30: Spelling suggestings SHOULD be here
ContextMenuItems: wow, <separator>, Ignore Spelling, Learn Spelling, <separator>, Search in Spotlight, Search in Google, <separator>, Look Up in Dictionary, <separator>, Cut, Copy, Paste, <separator>, Spelling, Font, Speech, Writing Direction
This test checks that spelling suggestions in the context menu are not show when spellcheck="false". To test manually, right click on the text in the input box.
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]):
2010-06-03 Kinuko Yasuda <kinuko@chromium.org>
Reviewed by Shinichiro Hamaji.
......
......@@ -122,7 +122,7 @@ BOOL replayingSavedEvents;
{
if (aSelector == @selector(beginDragWithFiles:)
|| aSelector == @selector(clearKillRing)
|| aSelector == @selector(contextClick:)
|| aSelector == @selector(contextClick)
|| aSelector == @selector(enableDOMUIEventLogging:)
|| aSelector == @selector(fireKeyboardEventsToElement:)
|| aSelector == @selector(keyDown:withModifiers:withLocation:)
......@@ -152,7 +152,7 @@ BOOL replayingSavedEvents;
{
if (aSelector == @selector(beginDragWithFiles:))
return @"beginDragWithFiles";
if (aSelector == @selector(contextClick:))
if (aSelector == @selector(contextClick))
return @"contextClick";
if (aSelector == @selector(enableDOMUIEventLogging:))
return @"enableDOMUIEventLogging";
......@@ -494,7 +494,7 @@ static int buildModifierFlags(const WebScriptObject* modifiers)
[self mouseScrollByX:x andY:y continuously:NO];
}
- (void)contextClick:(BOOL)shouldPrintMenuItems
- (NSArray *)contextClick
{
[[[mainFrame frameView] documentView] layout];
[self updateClickCountForButton:RightMouseButton];
......@@ -510,21 +510,24 @@ static int buildModifierFlags(const WebScriptObject* modifiers)
pressure:0.0];
NSView *subView = [[mainFrame webView] hitTest:[event locationInWindow]];
NSMutableArray *menuItemStrings = [NSMutableArray array];
if (subView) {
NSMenu* menu = [subView menuForEvent:event];
if (shouldPrintMenuItems) {
printf("ContextMenuItems: ");
for (int i = 0; i < [menu numberOfItems]; ++i) {
NSMenuItem* menuItem = [menu itemAtIndex:i];
if (!strcmp("Inspect Element", [[menuItem title] UTF8String]))
continue;
if (i > 0)
printf(", ");
fputs([menuItem isSeparatorItem] ? "<separator>" : [[menuItem title] UTF8String], stdout);
}
printf("\n");
for (int i = 0; i < [menu numberOfItems]; ++i) {
NSMenuItem* menuItem = [menu itemAtIndex:i];
if (!strcmp("Inspect Element", [[menuItem title] UTF8String]))
continue;
if ([menuItem isSeparatorItem])
[menuItemStrings addObject:@"<separator>"];
else
[menuItemStrings addObject:[menuItem title]];
}
}
return menuItemStrings;
}
- (void)scheduleAsynchronousClick
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment