-
Notifications
You must be signed in to change notification settings - Fork 975
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
Fixing issue with announcing of PropertyGrid expanded state #7242
Fixing issue with announcing of PropertyGrid expanded state #7242
Conversation
917e39e
to
5b5df9f
Compare
...ows.Forms/tests/UnitTests/System/Windows/Forms/PropertyGridInternal/PropertyGridViewTests.cs
Outdated
Show resolved
Hide resolved
...ows.Forms/tests/UnitTests/System/Windows/Forms/PropertyGridInternal/PropertyGridViewTests.cs
Outdated
Show resolved
Hide resolved
...ows.Forms/tests/UnitTests/System/Windows/Forms/PropertyGridInternal/PropertyGridViewTests.cs
Outdated
Show resolved
Hide resolved
...ows.Forms/tests/UnitTests/System/Windows/Forms/PropertyGridInternal/PropertyGridViewTests.cs
Outdated
Show resolved
Hide resolved
...ows.Forms/tests/UnitTests/System/Windows/Forms/PropertyGridInternal/PropertyGridViewTests.cs
Outdated
Show resolved
Hide resolved
...ows.Forms/tests/UnitTests/System/Windows/Forms/PropertyGridInternal/PropertyGridViewTests.cs
Outdated
Show resolved
Hide resolved
...ows.Forms/tests/UnitTests/System/Windows/Forms/PropertyGridInternal/PropertyGridViewTests.cs
Outdated
Show resolved
Hide resolved
...ows.Forms/tests/UnitTests/System/Windows/Forms/PropertyGridInternal/PropertyGridViewTests.cs
Outdated
Show resolved
Hide resolved
890a171
to
1c3e2e6
Compare
New unit test works as expected. There are some unstable tests here though. |
1c3e2e6
to
30dccba
Compare
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, just a few nits
public System.Drawing.Size SizeProperty | ||
{ | ||
get; set; | ||
} |
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.
public System.Drawing.Size SizeProperty | |
{ | |
get; set; | |
} | |
public System.Drawing.Size SizeProperty { get; set; } |
|
||
private class TestGridEntry : GridEntry | ||
{ | ||
readonly PropertyGridView _propertyGridView; |
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.
readonly PropertyGridView _propertyGridView; | |
private readonly PropertyGridView _propertyGridView; |
{ | ||
readonly PropertyGridView _propertyGridView; | ||
|
||
public TestGridEntry(PropertyGrid ownerGrid, GridEntry peParent, PropertyGridView propertyGridView) |
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.
public TestGridEntry(PropertyGrid ownerGrid, GridEntry peParent, PropertyGridView propertyGridView) | |
public TestGridEntry(PropertyGrid ownerGrid, GridEntry parent, PropertyGridView propertyGridView) |
propertyGridView.DropDownControl(new Control()); | ||
|
||
Assert.Equal(1, accessibleObject.RaiseAutomationNotificationCallCount); | ||
} |
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.
The test is still missing IsHandleCreated
checks, as @vladimir-krestov suggested.
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.
The test is still missing
IsHandleCreated
checks, as @vladimir-krestov suggested.
The test creates Handles for controls so Assert.False(IsHandleCreated) fails the test.
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 think you can do Assert.True(IsHandleCreated)
in that case
|
||
public int RaiseAutomationNotificationCallCount { get; set; } | ||
|
||
internal override bool InternalRaiseAutomationNotification(AutomationNotificationKind notificationKind, AutomationNotificationProcessing notificationProcessing, string notificationText) |
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.
internal override bool InternalRaiseAutomationNotification(AutomationNotificationKind notificationKind, AutomationNotificationProcessing notificationProcessing, string notificationText) | |
internal override bool InternalRaiseAutomationNotification(AutomationNotificationKind notificationKind, | |
AutomationNotificationProcessing notificationProcessing, string notificationText) |
{ | ||
} | ||
|
||
public int RaiseAutomationNotificationCallCount { get; set; } |
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.
public int RaiseAutomationNotificationCallCount { get; set; } | |
public int RaiseAutomationNotificationCallCount { get; private set; } |
1d96540
to
7978cb6
Compare
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.
👍
public System.Drawing.Size SizeProperty | ||
{ get; set; } |
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.
public System.Drawing.Size SizeProperty | |
{ get; set; } | |
public System.Drawing.Size SizeProperty { get; set; } |
7978cb6
to
e240517
Compare
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
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 to me! Please send it to CTI
CTI Testing requested. |
CTI test passed successfully. Let's rerun Pipeline tests. |
@dkazennov - looks like Vladimir can re-run tests, please ask him to get a faster turnaround. Or message in teams. I missed this request. |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
Assert.True(propertyGridView.IsAccessibilityObjectCreated); | ||
Assert.Equal(testGridEntry, selectedGridEntry); | ||
Assert.Equal(testGridEntry, gridEntries[selectedRow]); | ||
propertyGridView.DropDownControl(new Control()); |
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.
Control that you new-up is not Disposed
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 suspect that your test is crashing the test process. Does it pass in the VS? Does it pass from the command line? Had you tried running it individually -
dotnet test --filter <filter expression>
command by switching to the desired test project directory first.
per https://github.com/dotnet/winforms/blob/main/docs/testing.md#adding-new-unit-tests
|
||
using Button button = new(); | ||
propertyGrid.SelectedObject = button; | ||
GridEntryCollection gridEntries = propertyGridView.TestAccessor().Dynamic._allGridEntries; |
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 look up if property grid view is re-created when selection object is set. If this is the case, please split this test into several, each dedicated to a specific selection.
@Tanya-Solyanik so we concluded to drop off the unit test since it is unstable and there is almost no test coverage for announcements. |
…o Narrator. Periodically it announces expanded state information and periodically skips. A possible fix is to replace the standard method "RaiseAutomationPropertyChangedEvent" with the "RaiseAutomationNotification" method. In this case, we force the expanded state information to be announced, which helps avoid a possible contention problem.
e240517
to
145ea76
Compare
Fixes #6656
Finishes PR #6737
Proposed changes
Customer Impact
Before
After
Regression?
Risk
Test methodology
Accessibility testing
Test environment(s)
Microsoft Windows [Version 120.2212.4170.0]
.NET Core SDK: 7.0.100-preview.3.22179.4
Microsoft Reviewers: Open in CodeFlow