Conversation
UI Smoke TestsTest: success. 2 passed, 0 failed. |
| @@ -84,6 +89,11 @@ public virtual void Start() | |||
| View.Show(); | |||
|
|
|||
| SynchronizationContext.SetSynchronizationContext(new DispatcherSynchronizationContext()); | |||
There was a problem hiding this comment.
What will the current thread be typically in which this test fixture is set up?
There was a problem hiding this comment.
We run all our tests in a single thread (UI thread).
We set the current syncContext the same way WPF would set when running the application normally (DispatcherSynchronizationContext)
There was a problem hiding this comment.
It's surprising to me that if the tests are running in the UI thread, we have to do this explicitly. Perhaps this is a subtle difference between a main WPF app and a WPF test.
| var automation = this.ViewModel.Automation; | ||
| if (automation != null) | ||
| { | ||
| automation.PlaybackStateChanged -= OnAutomationPlaybackStateChanged; | ||
| } |
There was a problem hiding this comment.
It would be clearer if you refactored this into a corresponding UnregisterCommandCallback method to match with the RegisterCommandCallback method.
aparajit-pratap
left a comment
There was a problem hiding this comment.
Some comments, then LGTM!
|
Harmony fails on all builds. |
Refactor tests to use the test infrastructure properly (Setup and CLeanup)
Force Dispatcher to run all tasks before test ends (for most cases)
Refactor some SyncContext defaults to use the current one