Bug 148516

Summary: AX: Fix accessibility/select-element-at-index.html test
Product: WebKit Reporter: Nan Wang <n_wang>
Component: AccessibilityAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, apinheiro, cfleizach, commit-queue, dmazzoni, jcraig, jdiggs, mario, n_wang, samuel_white, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
See Also: https://bugs.webkit.org/show_bug.cgi?id=129039
Attachments:
Description Flags
patch
none
patch
none
patch
none
patch
none
patch
none
patch none

Description Nan Wang 2015-08-26 23:31:06 PDT
Test is marked skip in TestExpectation file.
Comment 1 Nan Wang 2015-08-26 23:46:45 PDT
Created attachment 260042 [details]
patch
Comment 2 Nan Wang 2015-08-26 23:56:24 PDT
Created attachment 260043 [details]
patch
Comment 3 Nan Wang 2015-08-27 00:06:50 PDT
Created attachment 260045 [details]
patch
Comment 4 chris fleizach 2015-08-27 00:16:30 PDT
Comment on attachment 260045 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=260045&action=review

> Tools/DumpRenderTree/AccessibilityUIElement.cpp:487
> +    int indexNumber = -1;

can we make this unsigned then we don't have to worry about >= 0

> Tools/DumpRenderTree/AccessibilityUIElement.cpp:498
> +    int indexNumber = -1;

ditto

> Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm:1408
> +    NSArray* selected = [m_element accessibilityAttributeValue:NSAccessibilitySelectedChildrenAttribute];

* is on wrong side because this is ObjC code. 
selected -> selectedChildren

> Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm:1409
> +    NSArray* array = [NSArray arrayWithObject:element.platformUIElement()];

ditto about *

> Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm:1420
> +    NSArray* selected = [m_element accessibilityAttributeValue:NSAccessibilitySelectedChildrenAttribute];

ditto

> Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm:1423
> +    NSMutableArray* array = [NSMutableArray arrayWithArray:selected];

ditto

> Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:1448
> +    NSArray* array = [NSArray arrayWithObject:element->platformUIElement()];

ditto

> Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:1459
> +    NSArray* selected = [m_element accessibilityAttributeValue:NSAccessibilitySelectedChildrenAttribute];

ditto

> Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:1464
> +    [m_element accessibilitySetValue:array forAttribute:NSAccessibilitySelectedChildrenAttribute];

i see that when we use this it performs it async which makes testing hard. there is a method

- (void)_accessibilitySetValue:(id)value forAttribute:(NSString*)attributeName

that is not async
Comment 5 Nan Wang 2015-08-27 10:56:52 PDT
Created attachment 260070 [details]
patch
Comment 6 chris fleizach 2015-08-27 11:07:03 PDT
Comment on attachment 260070 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=260070&action=review

> LayoutTests/accessibility/select-element-at-index.html:48
> +        if (accessibilityController.platformName == "mac") 

can you add a comment why this is necessary
Comment 7 Nan Wang 2015-08-27 11:20:19 PDT
Created attachment 260072 [details]
patch
Comment 8 Nan Wang 2015-08-27 12:04:51 PDT
Created attachment 260075 [details]
patch

Fix iOS build failure
Comment 9 WebKit Commit Bot 2015-08-27 12:21:46 PDT
Comment on attachment 260075 [details]
patch

Clearing flags on attachment: 260075

Committed r189044: <http://trac.webkit.org/changeset/189044>
Comment 10 WebKit Commit Bot 2015-08-27 12:21:51 PDT
All reviewed patches have been landed.  Closing bug.