Skip to content

Conversation

@elachlan
Copy link
Contributor

@elachlan elachlan commented Oct 24, 2022

Fixes #79
Related: #7981

Microsoft Reviewers: Open in CodeFlow

@elachlan elachlan requested a review from a team as a code owner October 24, 2022 22:06
@ghost ghost assigned elachlan Oct 24, 2022
Copy link
Contributor

@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.

I think you're on the right track, though a little more work is needed.

@ghost ghost added the waiting-author-feedback The team requires more information from the author label Oct 24, 2022
@elachlan elachlan force-pushed the FolderBrowserDialog-Test branch from 3cd9fa5 to e2aa454 Compare October 24, 2022 23:44
@ghost ghost removed the waiting-author-feedback The team requires more information from the author label Oct 24, 2022
@elachlan
Copy link
Contributor Author

Sorry for the force push, I rebased to main.

@RussKie
Copy link
Contributor

RussKie commented Oct 24, 2022

No worries at all, the diff is simple :)

{
timer.Stop();
Application.Exit();
Assert.Fail("Failed to close the dialog");
Copy link
Contributor

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.

Copy link
Contributor Author

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.

https://stackoverflow.com/questions/26514954/registration-free-com-interop-deactivating-activation-context-in-finalizer-thro

Copy link
Contributor Author

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 RussKie added the waiting-author-feedback The team requires more information from the author label Oct 26, 2022
@ghost ghost removed the waiting-author-feedback The team requires more information from the author label Oct 26, 2022
Copy link
Contributor

@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.

I think we're almost there :)

RussKie
RussKie previously approved these changes Oct 27, 2022
@RussKie RussKie enabled auto-merge (squash) October 27, 2022 01:51
@elachlan
Copy link
Contributor Author

Test is failing. Maybe its flaky? :(

@RussKie
Copy link
Contributor

RussKie commented Nov 1, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@dotnet dotnet deleted a comment from azure-pipelines bot Nov 1, 2022
@RussKie RussKie enabled auto-merge (squash) November 1, 2022 23:34
RussKie
RussKie previously approved these changes Nov 1, 2022
@RussKie RussKie disabled auto-merge November 2, 2022 01:18
@elachlan
Copy link
Contributor Author

elachlan commented Nov 2, 2022

No other test uses the InputSimulator directly like this. It wraps everything to make sure the Form/Control are focused and the input is done on the UI thread.

@elachlan
Copy link
Contributor Author

elachlan commented Nov 4, 2022

@RussKie I think you did it! Can you please rerun the pipeline?

@RussKie
Copy link
Contributor

RussKie commented Nov 4, 2022

Indeed :)

@RussKie
Copy link
Contributor

RussKie commented Nov 4, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@RussKie
Copy link
Contributor

RussKie commented Nov 4, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@RussKie
Copy link
Contributor

RussKie commented Nov 4, 2022

I'm going to run this few times to see if there are any flakiness to it.

@RussKie RussKie merged commit 46b18b2 into dotnet:main Nov 4, 2022
@ghost ghost added this to the 8.0 Preview1 milestone Nov 4, 2022
@RussKie
Copy link
Contributor

RussKie commented Nov 4, 2022

Thank you!

@elachlan elachlan deleted the FolderBrowserDialog-Test branch November 4, 2022 07:08
@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 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.

Add more tests to FolderBrowserDialog

2 participants