Skip to content
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

Merged

Conversation

M-Lipin
Copy link
Contributor

@M-Lipin M-Lipin commented May 5, 2020

Adding UIA providers support for Button's accessibility.

Fixes #3214

Proposed changes

  • Moving ButtonAccessibleObject to a separate file.
  • Moving ButtonBaseAccessibleObject to a separate file.
  • Adding UIA providers support for Button control accessi

Customer Impact

Regression?

  • No

Risk

  • Miniaml

Screenshots

Before

image

After

image

Test methodology

  • Manual testing.
  • Unit tests.
  • Automation tests (to be implemented).

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

@M-Lipin M-Lipin requested a review from a team as a code owner May 5, 2020 14:31
@ghost ghost assigned M-Lipin May 5, 2020
@M-Lipin M-Lipin changed the title Moving Button and ButtonBase accessible objects to separate files. Fixng 3214 - UIA providers support for Button control May 5, 2020
@M-Lipin
Copy link
Contributor Author

M-Lipin commented May 5, 2020

@Ryuugamine please implement unit tests.

Copy link
Member

@RussKie RussKie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests

@ghost ghost added the 📭 waiting-author-feedback The team requires more information from the author label May 7, 2020
@RussKie RussKie marked this pull request as draft May 7, 2020 01:53
Copy link
Member

@RussKie RussKie left a 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

@ghost ghost removed the 📭 waiting-author-feedback The team requires more information from the author label May 13, 2020
{
UiaCore.UIA.NamePropertyId => Name,
UiaCore.UIA.AutomationIdPropertyId
=> _owningButton.IsHandleCreated ? _owningButton.Name : string.Empty,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed

@SergeySmirnov-Akvelon SergeySmirnov-Akvelon force-pushed the Issue_3214_UIA_Accessibility_for_Button branch 2 times, most recently from bdca5d9 to adf6bc3 Compare June 18, 2020 08:49
@RussKie RussKie marked this pull request as ready for review June 19, 2020 04:05
@ghost ghost added the 📭 waiting-author-feedback The team requires more information from the author label Jun 19, 2020
@SergeySmirnov-Akvelon SergeySmirnov-Akvelon force-pushed the Issue_3214_UIA_Accessibility_for_Button branch from bb2d37c to 7165d80 Compare June 24, 2020 14:47

namespace System.Windows.Forms.Tests
{
public class ButtonBase_ButtonBaseAccessibleObjectTests
Copy link
Member

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;
Copy link
Member

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?

Copy link
Contributor

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

Copy link
Member

@RussKie RussKie left a 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 👍

Copy link
Contributor

@vladimir-krestov vladimir-krestov left a 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">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment
And also think about merge conflicts with the same resource in #3228

Copy link
Contributor

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)
Copy link
Contributor

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

Comment on lines 11 to 16
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;
Copy link
Contributor

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;
Copy link
Contributor

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();
Copy link
Contributor

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

@SergeySmirnov-Akvelon SergeySmirnov-Akvelon force-pushed the Issue_3214_UIA_Accessibility_for_Button branch from 589b3b6 to 41c92ea Compare June 25, 2020 13:55
@codecov
Copy link

codecov bot commented Jun 25, 2020

Codecov Report

Merging #3215 into master will increase coverage by 31.55858%.
The diff coverage is 99.42197%.

@@                 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     
Flag Coverage Δ
#Debug 98.50971% <99.42197%> (+31.55857%) ⬆️
#production ?
#test 98.50971% <99.42197%> (-0.00814%) ⬇️

@SergeySmirnov-Akvelon SergeySmirnov-Akvelon force-pushed the Issue_3214_UIA_Accessibility_for_Button branch 3 times, most recently from ace8d53 to af91c7e Compare June 26, 2020 14:13
@SergeySmirnov-Akvelon SergeySmirnov-Akvelon removed the 📭 waiting-author-feedback The team requires more information from the author label Jun 26, 2020
@SergeySmirnov-Akvelon SergeySmirnov-Akvelon added the waiting-review This item is waiting on review by one or more members of team label Jun 26, 2020
@SergeySmirnov-Akvelon
Copy link
Contributor

CTI approved

Adding UIA providers support for Button's accessibility.
@SergeySmirnov-Akvelon SergeySmirnov-Akvelon force-pushed the Issue_3214_UIA_Accessibility_for_Button branch from af91c7e to db2d0c1 Compare June 30, 2020 09:37
@RussKie
Copy link
Member

RussKie commented Jun 30, 2020

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@dotnet dotnet deleted a comment from azure-pipelines bot Jun 30, 2020
@dotnet dotnet deleted a comment from azure-pipelines bot Jun 30, 2020
@RussKie RussKie removed the waiting-review This item is waiting on review by one or more members of team label Jun 30, 2020
@RussKie RussKie merged commit fdb4350 into dotnet:master Jun 30, 2020
@RussKie RussKie deleted the Issue_3214_UIA_Accessibility_for_Button branch June 30, 2020 10:50
@ghost ghost added this to the 5.0 Preview8 milestone Jun 30, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Feb 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Button control does not support UIA accessibility
5 participants