-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Adding UIA support for TrackBar #4939
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding UIA support for TrackBar #4939
Conversation
fad0c3b to
0eeb489
Compare
24c2518 to
d605848
Compare
d605848 to
5561a94
Compare
vladimir-krestov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Good work!
Main points:
- Check Handle using
- Naming and indentation
- Methods and properties ordering in files
- Where are unit tests for TrackBar child base class?
src/System.Windows.Forms/src/System/Windows/Forms/TrackBar.TrackBarAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/TrackBar.TrackBarAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/TrackBar.TrackBarAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/TrackBar.TrackBarAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/TrackBar.TrackBarAccessibleObject.cs
Outdated
Show resolved
Hide resolved
...Forms/tests/UnitTests/AccessibleObjects/TrackBar.TrackBarFirstButtonAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
...Forms/tests/UnitTests/AccessibleObjects/TrackBar.TrackBarFirstButtonAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
....Forms/tests/UnitTests/AccessibleObjects/TrackBar.TrackBarLastButtonAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
....Forms/tests/UnitTests/AccessibleObjects/TrackBar.TrackBarLastButtonAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
...ndows.Forms/tests/UnitTests/AccessibleObjects/TrackBar.TrackBarThumbAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
0aede10 to
5c22848
Compare
RussKie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concerned with the tests implementations. Tests should have cyclomatic complexity (CC) of 1, i.e. not if...else....
In some instances (like if (createControl) ...) we decided to break this rule, but some tests seem to be really pushing it and have CC > 2. Please consider how the tests can be changed to reduce CC.
src/System.Windows.Forms/src/System/Windows/Forms/TrackBar.TrackBarAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/TrackBar.TrackBarChildAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/TrackBars.Designer.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/tests/IntegrationTests/WinformsControlsTest/TrackBars.cs
Outdated
Show resolved
Hide resolved
...em.Windows.Forms/tests/UnitTests/AccessibleObjects/TrackBar.TrackBarAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
...em.Windows.Forms/tests/UnitTests/AccessibleObjects/TrackBar.TrackBarAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
...Forms/tests/UnitTests/AccessibleObjects/TrackBar.TrackBarFirstButtonAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
...Forms/tests/UnitTests/AccessibleObjects/TrackBar.TrackBarFirstButtonAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
...Forms/tests/UnitTests/AccessibleObjects/TrackBar.TrackBarFirstButtonAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
vladimir-krestov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks better
src/System.Windows.Forms/src/System/Windows/Forms/TrackBar.TrackBarAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/TrackBar.TrackBarChildAccessibleObject.cs
Outdated
Show resolved
Hide resolved
11cf2c1 to
dff3736
Compare
dff3736 to
1e68e15
Compare
e06da86 to
914be23
Compare
|
CTI approved |
|
MC |
914be23 to
f6dddeb
Compare
|
@RussKie, thank you. Fixed MC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, my main question is if names match those in WPF or other framework.
If you open and close a form with a trackbar under inspect, is the trackbar still rooted?
Other comments are nits.
src/System.Windows.Forms/src/System/Windows/Forms/TrackBar.TrackBarAccessibleObject.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would /// <inheritdoc/> work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It works. But I checked, even if we delete /// <summary> and /// <inheritdoc/>, then the description from the based "AccessibleObject" class is used.
Removed unneeded <summary> from this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I checked, even if we delete ///
and /// , then the description from the based "AccessibleObject" class is used.
Interesting. Maybe inheritdocs is used by the tools that generate docs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I checked, even if we delete
/// <summary>and/// <inheritdoc/>, then the description from the based "AccessibleObject" class is used.
Are you sure? If you don't have a /// comment then you don't get intellisense nor docs for the given member.
https://docs.microsoft.com/dotnet/csharp/programming-guide/xmldoc/inheritdoc
src/System.Windows.Forms/src/System/Windows/Forms/TrackBar.TrackBarAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/TrackBar.TrackBarAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/TrackBar.TrackBarAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/TrackBar.TrackBarChildAccessibleObject.cs
Outdated
Show resolved
Hide resolved
f6dddeb to
144d622
Compare
Hi, @Tanya-Solyanik. I have checked this case for Inspect and Narrator. TrackBar accessibility objects are removed from memory even if these accessibility tools are active |
src/System.Windows.Forms/src/System/Windows/Forms/TrackBar.TrackBarAccessibleObject.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't we use this?
| public static IEnumerable<object[]> TrackBarAccessibleObject_FirstButtonIsDisplayed_TestData() | |
| => TrackBarTestHelper.TrackBarAccessibleObject_FirstButtonIsDisplayed_TestData(); | |
| [WinFormsTheory] | |
| [MemberData(nameof(TrackBarAccessibleObject_FirstButtonIsDisplayed_TestData))] | |
| [WinFormsTheory] | |
| [CommonMemberData(typeof(TrackBarTestHelper), nameof(TrackBarTestHelper.TrackBarAccessibleObject_FirstButtonIsDisplayed_TestData))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much!!! Your approach makes it much easier to use the "TrackBarTestHelper" class.
20b698d to
fd63914
Compare
Updated "SupportsUiaProviders" flag. Added and implemented "TrackBarAccessibleObject", "TrackBarFirstButtonAccessibleObject", "TrackBarLastButtonAccessibleObject" and "TrackBarThumbAccessibleObject" classes for working with the TrackBar and its elements. Added calls to "RaiseAutomationPropertyChangedEvent" and "RaiseAutomationEvent" methods for the correct announcing of the Narrator Added unit tests
fd63914 to
e840b5d
Compare
Tanya-Solyanik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see a comment about opening a bug to test if accessible object is created across the whole codebase.
Fixes #4914
Proposed changes
SupportsUiaProvidersflag.TrackBarAccessibleObject,TrackBarFirstButtonAccessibleObject,TrackBarLastButtonAccessibleObjectandTrackBarThumbAccessibleObjectclasses for working with theTrackBarand its elements.RaiseAutomationPropertyChangedEventandRaiseAutomationEventmethods for the correct announcing of the NarratorCustomer Impact
Before fix:

ProviderDescription: "[pid:9884,providerId:0x280FE0 Main:Nested [pid:28360,providerId:0x280FE0 Main(parent link):Microsoft: MSAA Proxy (unmanaged:UIAutomationCore.dll)]; Nonclient:Microsoft: Non-Client Proxy (unmanaged:uiautomationcore.dll); Hwnd(parent link):Microsoft: HWND Proxy (unmanaged:uiautomationcore.dll)]"After fix:

ProviderDescription: "[pid:25616,providerId:0x90BDA Main:Nested [pid:25228,providerId:0x90BDA Main(parent link):Unidentified Provider (unmanaged:coreclr.dll)]; Hwnd(parent link):Microsoft: HWND Proxy (unmanaged:uiautomationcore.dll)]"Regression?
Risk
Test methodology
Accessibility testing
Test environment(s)
Microsoft Reviewers: Open in CodeFlow