Adding CheckBox control UIA accessibility#3228
Conversation
src/System.Windows.Forms/src/System/Windows/Forms/CheckBox.CheckBoxAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/CheckBox.CheckBoxAccessibleObject.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Argument(Null)Exception seems inappropriate for reading a property
There was a problem hiding this comment.
Thanks, fixed.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
I've looked at the available exceptions, and I think it should be ArgumentException
There was a problem hiding this comment.
I suggest to also add an error message, something like Argument '{0}' cannot be converted to type '{1}'.
Similar to
winforms/src/Microsoft.VisualBasic.Forms/src/Resources/SR.resx
Lines 128 to 130 in 7ccf509
| public CheckBoxAccessibleObject(CheckBox owner) : base(owner) | |
| public CheckBoxAccessibleObject(Control owner) | |
| : base((owner as CheckBox) ?? throw new ArgumentException(string.Format(SR.Argument_InvalidValueType, nameof(Owner), typeof(CheckBox)), nameof(Owner))) |
There was a problem hiding this comment.
Is there a reason why you don't want to let the compiler do the work of ensuring the type (by declaring the argument type CheckBox and just doing a null check) ?
Declaring the argument type Control but throwing on anything but a CheckBox seems weird.
There was a problem hiding this comment.
Normally we would force CheckBox owner, however unlike many other accessibility API, this one is a public API, and changing type would be a breaking change. Granted it won't properly work with any other type, but this seems to be a lesser breaking change.
There was a problem hiding this comment.
oh, didn't notice that, yes changing the signature of a public API will cause MethodNotFound when you run a 3.x program on the 5.0 runtime (a secenario that was declared as desirable in previous discussions)
There was a problem hiding this comment.
Haha, I made the same mistake 3 hours earlier, and then Mikhail alerted me to the same fact.
There was a problem hiding this comment.
There has to be a pretty important reason to break the API surface. I can't even come up with a hypothetical case where we would (security perhaps, but I can't imagine a way we couldn't address a security problem that requires us to change the surface area).
There was a problem hiding this comment.
Thanks, fixed.
|
Please rework the PR in the following manner:
|
733b49e to
b4d6c65
Compare
Codecov Report
@@ Coverage Diff @@
## master #3228 +/- ##
====================================================
- Coverage 62.14766% 34.18230% -27.96537%
====================================================
Files 1257 891 -366
Lines 449428 253798 -195630
Branches 39227 36786 -2441
====================================================
- Hits 279309 86754 -192555
+ Misses 164638 162283 -2355
+ Partials 5481 4761 -720
|
There was a problem hiding this comment.
OwningCheckBox can never be null
Same below
There was a problem hiding this comment.
Thanks, fixed.
src/System.Windows.Forms/src/System/Windows/Forms/CheckBox.CheckBoxAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/tests/UnitTests/AccessibleObjects/CheckBoxAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/tests/UnitTests/AccessibleObjects/CheckBoxAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/CheckBox.CheckBoxAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/tests/UnitTests/AccessibleObjects/CheckBoxAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/CheckBox.CheckBoxAccessibleObject.cs
Outdated
Show resolved
Hide resolved
|
Please keep checks, just a comment.
Once the bug is fixed we'll update the code.
Please work with Mikhail through the issue to have a resolution plan. We'll sync up next week on this.
________________________________
From: Sergey Smirnov <notifications@github.com>
Sent: Thursday, 4 June 2020 6:59 PM
To: dotnet/winforms <winforms@noreply.github.com>
Cc: Igor Velikorossov <Igor.Velikorossov@microsoft.com>; Review requested <review_requested@noreply.github.com>
Subject: Re: [dotnet/winforms] Adding CheckBox control UIA accessibility (#3228)
@SergeySmirnov-Akvelon commented on this pull request.
________________________________
In src/System.Windows.Forms/tests/UnitTests/AccessibleObjects/CheckBoxAccessibleObjectTests.cs<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdotnet%2Fwinforms%2Fpull%2F3228%23discussion_r435100223&data=02%7C01%7Cigor.velikorossov%40microsoft.com%7Cf1659f7e07c64ff5142108d80865a876%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637268580001823931&sdata=QsnKnvyBTpmc%2BmATknoteDj%2BH3jE3e34vIotmnGhjF8%3D&reserved=0>:
@@ -0,0 +1,54 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Collections.Generic;
+using Xunit;
+
+namespace System.Windows.Forms.Tests
+{
+ public class CheckBoxAccessibleObjectTests
+ {
+ [WinFormsFact]
+ public void CheckBoxAccessibleObject_GetPropertyValue_returns_correct_values()
Currently we have issue with "IsHandleCreated" property. "AccessibleObject" class gets "Handle" control's property in constructor. As result, "IsHandleCreated" always will return "true" after creation of AccessibleObject. I removed checking of this property from tests.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdotnet%2Fwinforms%2Fpull%2F3228%23discussion_r435100223&data=02%7C01%7Cigor.velikorossov%40microsoft.com%7Cf1659f7e07c64ff5142108d80865a876%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637268580001823931&sdata=QsnKnvyBTpmc%2BmATknoteDj%2BH3jE3e34vIotmnGhjF8%3D&reserved=0>, or unsubscribe<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABBTEXSFNL7XFZ7WIMVHIDDRU5PA3ANCNFSM4M2WFHQQ&data=02%7C01%7Cigor.velikorossov%40microsoft.com%7Cf1659f7e07c64ff5142108d80865a876%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637268580001833924&sdata=6J0RBUfatMfOKHeoxtI2f7qtYGbmNxO1wINkt3Ww0PE%3D&reserved=0>.
|
src/System.Windows.Forms/tests/UnitTests/AccessibleObjects/CheckBoxAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/tests/UnitTests/AccessibleObjects/CheckBoxAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/tests/UnitTests/AccessibleObjects/CheckBoxAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/tests/UnitTests/AccessibleObjects/CheckBoxAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/tests/UnitTests/AccessibleObjects/CheckBoxAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
bd5a96f to
71a279d
Compare
src/System.Windows.Forms/tests/UnitTests/AccessibleObjects/CheckBoxAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/CheckBox.CheckBoxAccessibleObject.cs
Outdated
Show resolved
Hide resolved
a641c62 to
38c86e4
Compare
Codecov Report
@@ Coverage Diff @@
## master #3228 +/- ##
====================================================
- Coverage 66.58991% 35.38037% -31.20955%
====================================================
Files 1338 896 -442
Lines 501564 253553 -248011
Branches 40847 36764 -4083
====================================================
- Hits 333991 89708 -244283
+ Misses 162033 159012 -3021
+ Partials 5540 4833 -707
|
38c86e4 to
9304099
Compare
vladimir-krestov
left a comment
There was a problem hiding this comment.
Some code style issues
src/System.Windows.Forms/src/System/Windows/Forms/CheckBox.CheckBoxAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/CheckBox.CheckBoxAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/CheckBox.CheckBoxAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/CheckBox.CheckBoxAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/CheckBox.CheckBoxAccessibleObject.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/CheckBox.CheckBoxAccessibleObject.cs
Outdated
Show resolved
Hide resolved
...em.Windows.Forms/tests/UnitTests/AccessibleObjects/CheckBox.CheckBoxAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
...em.Windows.Forms/tests/UnitTests/AccessibleObjects/CheckBox.CheckBoxAccessibleObjectTests.cs
Outdated
Show resolved
Hide resolved
d083f46 to
32070ac
Compare
|
Issue has been tested, but another one has been found in Narrator, so i will investigate it |
|
CTI approved |
6c25ae3 to
2afb6ab
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Issue is reproduced because we used incorrect propertyId. We should use the NamePropertyId instead of the ToggleToggleStatePropertyId.
2afb6ab to
ca99ed0
Compare
Codecov Report
@@ Coverage Diff @@
## master #3228 +/- ##
====================================================
+ Coverage 66.99234% 98.49463% +31.50229%
====================================================
Files 1348 452 -896
Lines 505822 252829 -252993
Branches 40904 4167 -36737
====================================================
- Hits 338862 249023 -89839
+ Misses 161389 3092 -158297
+ Partials 5571 714 -4857
|
Fixes #3227
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