-
Notifications
You must be signed in to change notification settings - Fork 945
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
Fixng 3214 - UIA providers support for Button control #3215
Fixng 3214 - UIA providers support for Button control #3215
Conversation
@Ryuugamine please implement unit tests. |
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.
Tests
src/System.Windows.Forms/src/System/Windows/Forms/Button.ButtonAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/Button.ButtonAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/ButtonBase.ButtonBaseAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/ButtonBase.ButtonBaseAccessibleObject.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.
Multiple NRT issues, the PR will need to be rebased on top of #3273
src/System.Windows.Forms/src/System/Windows/Forms/ButtonBase.ButtonBaseAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/ButtonBase.ButtonBaseAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/ButtonBase.ButtonBaseAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/ButtonBase.ButtonBaseAccessibleObject.cs
Outdated
Show resolved
Hide resolved
{ | ||
UiaCore.UIA.NamePropertyId => Name, | ||
UiaCore.UIA.AutomationIdPropertyId | ||
=> _owningButton.IsHandleCreated ? _owningButton.Name : string.Empty, |
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.
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.
Thanks, fixed
src/System.Windows.Forms/src/System/Windows/Forms/Button.ButtonAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/ButtonBase.ButtonBaseAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/ButtonBase.ButtonBaseAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/ButtonBase.ButtonBaseAccessibleObject.cs
Outdated
Show resolved
Hide resolved
bdca5d9
to
adf6bc3
Compare
src/System.Windows.Forms/src/System/Windows/Forms/ButtonBase.ButtonBaseAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ButtonAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ButtonAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ButtonAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/ButtonBase.ButtonBaseAccessibleObject.cs
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/ButtonBase.ButtonBaseAccessibleObject.cs
Show resolved
Hide resolved
src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ButtonAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
bb2d37c
to
7165d80
Compare
|
||
namespace System.Windows.Forms.Tests | ||
{ | ||
public class ButtonBase_ButtonBaseAccessibleObjectTests |
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.
I updated the test docs to reflect the decision
https://github.com/dotnet/winforms/blob/master/Documentation/testing.md#naming
/cc: @hughbe FYI
{ | ||
} | ||
|
||
private ButtonBase OwningButton => (ButtonBase)Owner; |
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.
Have we reached an agreement in this?
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 should be changed to a local readonly field
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.
1 naming Q, other than that looks good 👍
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.
LGTM but need rework ButtonBaseAccessibleObject
constructor
@@ -6710,4 +6710,7 @@ Stack trace where the illegal operation occurred was: | |||
<data name="InputLanguageCultureNotFound" xml:space="preserve"> | |||
<value>Could not find an InputLanguage for culture '{0}'.</value> | |||
</data> | |||
<data name="Argument_InvalidValueType" xml:space="preserve"> |
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.
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.
Probably, but we need these changes in both PRs
_ => base.GetPropertyValue(propertyID) | ||
}; | ||
|
||
internal override bool IsPatternSupported(UiaCore.UIA patternId) |
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.
It is not necessary now due to #3412
public ButtonBaseAccessibleObject(Control owner) | ||
: base((owner as ButtonBase) ?? throw new ArgumentException(string.Format(SR.Argument_InvalidValueType, nameof(Owner), typeof(ButtonBase)))) | ||
{ | ||
} | ||
|
||
private ButtonBase OwningButton => (ButtonBase)Owner; |
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.
Comment, please make like this
{ | ||
} | ||
|
||
private ButtonBase OwningButton => (ButtonBase)Owner; |
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 should be changed to a local readonly field
[InlineData(false, false, AccessibleRole.HelpBalloon)] | ||
public void ButtonBase_CreateAccessibilityInstance_InvokeWithRole_ReturnsExpected(bool createControl, bool defaultRole, AccessibleRole expectedAccessibleRole) | ||
{ | ||
using var control = new SubButtonBase(); |
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 add a blank line before if
everywhere
589b3b6
to
41c92ea
Compare
Codecov Report
@@ Coverage Diff @@
## master #3215 +/- ##
====================================================
+ Coverage 66.95113% 98.50971% +31.55857%
====================================================
Files 1338 448 -890
Lines 504925 251964 -252961
Branches 40866 4155 -36711
====================================================
- Hits 338053 248209 -89844
+ Misses 161315 3038 -158277
+ Partials 5557 717 -4840
|
ace8d53
to
af91c7e
Compare
CTI approved |
Adding UIA providers support for Button's accessibility.
af91c7e
to
db2d0c1
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Adding UIA providers support for Button's accessibility.
Fixes #3214
Proposed changes
Customer Impact
Regression?
Risk
Screenshots
Before
After
Test methodology
Accessibility testing
Test environment(s)
.NET Core 5.0
Version: 5.0.100-alpha.1.20073.10
Commit: 29f4d693a9
Runtime Environment:
OS Name: Windows
OS Version: 10.0.18363
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.100-alpha1-05536
Host (useful for support):
Version: 5.0.0-alpha.1.20072.3
Commit: c3dc1fdfdc
Microsoft Reviewers: Open in CodeFlow