-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add Test for FolderBrowserDialog #8021
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
Conversation
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.
I think you're on the right track, though a little more work is needed.
src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/FolderBrowserDialogTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/FolderBrowserDialogTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/FolderBrowserDialogTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/FolderBrowserDialogTests.cs
Outdated
Show resolved
Hide resolved
3cd9fa5 to
e2aa454
Compare
|
Sorry for the force push, I rebased to main. |
|
No worries at all, the diff is simple :) |
src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/FolderBrowserDialogTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/FolderBrowserDialogTests.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/FolderBrowserDialogTests.cs
Outdated
Show resolved
Hide resolved
| { | ||
| timer.Stop(); | ||
| Application.Exit(); | ||
| Assert.Fail("Failed to close the dialog"); |
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.
My local tests didn't indicate this will be hit or result in a failed 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.
It works if I use only Assert.Fail().
I was looking into the exception caused by ThemingScope.Deactivate(userCookie); in CommonDialog.cs. The call to PInvoke.DeactivateActCtx causes the exception only if Application.Exit() or Assert.Fail() is called from the timer.tick event. I think this is threading related but I am not 100% sure.
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.
With this latest code, the vista version throws an exception because of an E_UNEXPECTED HRESULT returned from GetResult in this call chain. dialog->GetResult(item).ThrowOnFailure();.
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.
I think we're almost there :)
src/System.Windows.Forms/tests/IntegrationTests/UIIntegrationTests/FolderBrowserDialogTests.cs
Outdated
Show resolved
Hide resolved
…ests/FolderBrowserDialogTests.cs
|
Test is failing. Maybe its flaky? :( |
…ms into FolderBrowserDialog-Test
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
No other test uses the |
|
@RussKie I think you did it! Can you please rerun the pipeline? |
|
Indeed :) |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
I'm going to run this few times to see if there are any flakiness to it. |
|
Thank you! |
Fixes #79
Related: #7981
Microsoft Reviewers: Open in CodeFlow