Bug 505759

Summary: Erroneous selectChild behavior for ToolStripSplitButton
Product: [Mono] UI Automation Reporter: Brian Merrell <bgmerrell>
Component: Winforms - GeneralAssignee: E-mail List <mono-a11y-bugs>
Status: NEW --- QA Contact: E-mail List <mono-a11y-qa>
Severity: Normal    
Priority: P3 - Medium CC: cachen
Version: Release 1.0   
Target Milestone: ---   
Hardware: x86   
OS: openSUSE 11.1   
Whiteboard:
Found By: Integration Test Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: test case application (written in IronPython)

Description Brian Merrell 2009-05-20 17:35:53 UTC
PROBLEM STATEMENT

the ToolStripSplitButton sample application GUI (uia2atk/test/samples/toolstripsplitbutton.py) is designed to update its "The current font size" label whenever a ToolStripSplitButton menu item is clicked.  The problem is that calling the selectChild (from the AtkSelection interface) on a ToolStripSplitButton's "toggle button" accessible, causes the GUI to act just
like the menu item child selected by the selectChild method was clicked.  Additionally, the menu item child selected by the selectChild method also gets the "focused" and "selected", which I don't think should be the case when the behavior is just like performing the 'click' action--like it is here--since the 'click' action should remove the "focused" and "selected" states from the clicked menu item(according to the Bridge functional spec).  After discussing this with Brad, it seems like the correct behavior would be for the menu item that is selected using selectChild() to simply get the "selected" state. 

REPRO

1.  Run Accerciser
2.  Run uia2atk/test/samples/toolstripsplitbutton.py
3.  In Accerciser's left pane, browse to and select the "toggle button" accessible of the toolstripsplitbutton.py (ipy) application.
4.  In Accerciser, click on the "IPython Console" tab and type the following "acc.querySelection().selectChild(2)" and press enter.  (Notice that the GUI label updates to read "The current font size if 14".)
5.  In Accerciser's left pane, select the "menu item" accessible with the name of "14".
6.  In Accerciser, open the "Interface Viewer" tab and expand the "Accessible" expander.

RESULTS

The GUI label updated to read "The current font size if 14" and the "menu item" with the name of "14" has the "selected" and "focused" states.

EXPECTED RESULTS

The GUI label should not update (because we didn't perform a click action) and the "menu item" with the name of "14" should only have the "selected" state since the ToolStripSplitButton is collapsed.  If the ToolStripSplitButton is not collapsed, I think it would make sense for the selected "menu item" accessible to have the "focused" state.

COMMENTS

This bug is related to an e-mail question I sent to the mono-a11y mailing list on May 20, 2009 (http://forge.novell.com/mailman/private/mono-a11y/2009-May/001858.html).

Below is a relevant IRC discussion on the topic:

10:21 <@brad> bgmerrell: what makes the most sense to you
10:24 <@brad> bgmerrell: maybe just +selected?
10:24 <@bgmerrell> i don't think it's meant to be 'just another way to 
                   click' something in the way we are treating it in some 
                   situations
10:24 <@brad> right
10:25 <@bgmerrell> brad: yeah, +selected and if the item is showing then 
                   +selected and +focused?
10:25 <@brad> bgmerrell: yea
Comment 1 Brian Merrell 2009-05-20 18:06:04 UTC
Created attachment 293403 [details]
test case application (written in IronPython)

Here is a separate test case for something that is mentioned in the EXPECTED RESULTS.  This script performs the 'click' action on the "toggle bar" accessible before calling the selectChild method.  This is needed to ensure that the selected child (the "12" "menu item" in the case of this script) gains the "selected" *and* the "focused" state if the menu is open and the menu item is showing.