{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/RTVS/pulls/comments/64780961","id":64780961,"diff_hunk":"@@ -116,6 +117,12 @@ public class UIThreadHelper {\n             return args.Exception;\n         }\n \n+        public Task DoEventsAsync() {\n+            return TaskUtilities.IsOnBackgroundThread()\n+                ? _application.Dispatcher.InvokeAsync(() => { }, DispatcherPriority.Background).Task\n+                : Task.Run(DoEventsAsync);","path":"src/UnitTests/Core/Impl/Threading/UIThreadHelper.cs","position":15,"original_position":15,"commit_id":"9799afe474df28a9aee9dceb5f1cc73e372cb802","original_commit_id":"9799afe474df28a9aee9dceb5f1cc73e372cb802","user":{"login":"AlexanderSher","id":8933858,"avatar_url":"https://avatars.githubusercontent.com/u/8933858?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexanderSher","html_url":"https://github.com/AlexanderSher","followers_url":"https://api.github.com/users/AlexanderSher/followers","following_url":"https://api.github.com/users/AlexanderSher/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderSher/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderSher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderSher/subscriptions","organizations_url":"https://api.github.com/users/AlexanderSher/orgs","repos_url":"https://api.github.com/users/AlexanderSher/repos","events_url":"https://api.github.com/users/AlexanderSher/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderSher/received_events","type":"User","site_admin":false},"body":"If method is called from background thread, it schedules a task in `Dispatcher`. If not, it calls itself from background thread.","created_at":"2016-05-26T16:54:20Z","updated_at":"2016-05-26T16:54:21Z","html_url":"https://github.com/Microsoft/RTVS/pull/1821#discussion_r64780961","pull_request_url":"https://api.github.com/repos/Microsoft/RTVS/pulls/1821","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/RTVS/pulls/comments/64780961"},"html":{"href":"https://github.com/Microsoft/RTVS/pull/1821#discussion_r64780961"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/RTVS/pulls/1821"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/RTVS/pulls/1821","id":71511610,"html_url":"https://github.com/Microsoft/RTVS/pull/1821","diff_url":"https://github.com/Microsoft/RTVS/pull/1821.diff","patch_url":"https://github.com/Microsoft/RTVS/pull/1821.patch","issue_url":"https://api.github.com/repos/Microsoft/RTVS/issues/1821","number":1821,"state":"open","locked":false,"title":"Support showing WPF windows in unit tests","user":{"login":"AlexanderSher","id":8933858,"avatar_url":"https://avatars.githubusercontent.com/u/8933858?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexanderSher","html_url":"https://github.com/AlexanderSher","followers_url":"https://api.github.com/users/AlexanderSher/followers","following_url":"https://api.github.com/users/AlexanderSher/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderSher/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderSher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderSher/subscriptions","organizations_url":"https://api.github.com/users/AlexanderSher/orgs","repos_url":"https://api.github.com/users/AlexanderSher/repos","events_url":"https://api.github.com/users/AlexanderSher/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderSher/received_events","type":"User","site_admin":false},"body":"`ContainerHostMethodFixture` can be referenced in test class constructor. For such test, before constructor is called, `ContainerHostMethodFixture` will create WPF window.\r\n`ContainerHostMethodFixture.AddToHost` adds `UIElement` to the window. Up to 9 elements can be added at the same time.\r\nSeveral tests that run concurrently will share the same window, so parallel execution may be limited by the maximum amount of allowed elements.\r\n\r\nTo wait until window is updated, use `UIThreadTools.DoEvents` or `UIThreadHelper.Instance.DoEventsAsync`","created_at":"2016-05-26T07:29:15Z","updated_at":"2016-05-26T16:54:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d16f6043b2ec921abf4e0b134f479bafd252aaff","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/RTVS/pulls/1821/commits","review_comments_url":"https://api.github.com/repos/Microsoft/RTVS/pulls/1821/comments","review_comment_url":"https://api.github.com/repos/Microsoft/RTVS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/RTVS/issues/1821/comments","statuses_url":"https://api.github.com/repos/Microsoft/RTVS/statuses/9799afe474df28a9aee9dceb5f1cc73e372cb802","head":{"label":"AlexanderSher:ShowWindowInUnitTests","ref":"ShowWindowInUnitTests","sha":"9799afe474df28a9aee9dceb5f1cc73e372cb802","user":{"login":"AlexanderSher","id":8933858,"avatar_url":"https://avatars.githubusercontent.com/u/8933858?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexanderSher","html_url":"https://github.com/AlexanderSher","followers_url":"https://api.github.com/users/AlexanderSher/followers","following_url":"https://api.github.com/users/AlexanderSher/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderSher/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderSher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderSher/subscriptions","organizations_url":"https://api.github.com/users/AlexanderSher/orgs","repos_url":"https://api.github.com/users/AlexanderSher/repos","events_url":"https://api.github.com/users/AlexanderSher/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderSher/received_events","type":"User","site_admin":false},"repo":{"id":53532014,"name":"RTVS","full_name":"AlexanderSher/RTVS","owner":{"login":"AlexanderSher","id":8933858,"avatar_url":"https://avatars.githubusercontent.com/u/8933858?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexanderSher","html_url":"https://github.com/AlexanderSher","followers_url":"https://api.github.com/users/AlexanderSher/followers","following_url":"https://api.github.com/users/AlexanderSher/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderSher/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderSher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderSher/subscriptions","organizations_url":"https://api.github.com/users/AlexanderSher/orgs","repos_url":"https://api.github.com/users/AlexanderSher/repos","events_url":"https://api.github.com/users/AlexanderSher/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderSher/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AlexanderSher/RTVS","description":"R Tools for Visual Studio.","fork":true,"url":"https://api.github.com/repos/AlexanderSher/RTVS","forks_url":"https://api.github.com/repos/AlexanderSher/RTVS/forks","keys_url":"https://api.github.com/repos/AlexanderSher/RTVS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlexanderSher/RTVS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlexanderSher/RTVS/teams","hooks_url":"https://api.github.com/repos/AlexanderSher/RTVS/hooks","issue_events_url":"https://api.github.com/repos/AlexanderSher/RTVS/issues/events{/number}","events_url":"https://api.github.com/repos/AlexanderSher/RTVS/events","assignees_url":"https://api.github.com/repos/AlexanderSher/RTVS/assignees{/user}","branches_url":"https://api.github.com/repos/AlexanderSher/RTVS/branches{/branch}","tags_url":"https://api.github.com/repos/AlexanderSher/RTVS/tags","blobs_url":"https://api.github.com/repos/AlexanderSher/RTVS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlexanderSher/RTVS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlexanderSher/RTVS/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlexanderSher/RTVS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlexanderSher/RTVS/statuses/{sha}","languages_url":"https://api.github.com/repos/AlexanderSher/RTVS/languages","stargazers_url":"https://api.github.com/repos/AlexanderSher/RTVS/stargazers","contributors_url":"https://api.github.com/repos/AlexanderSher/RTVS/contributors","subscribers_url":"https://api.github.com/repos/AlexanderSher/RTVS/subscribers","subscription_url":"https://api.github.com/repos/AlexanderSher/RTVS/subscription","commits_url":"https://api.github.com/repos/AlexanderSher/RTVS/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlexanderSher/RTVS/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlexanderSher/RTVS/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlexanderSher/RTVS/issues/comments{/number}","contents_url":"https://api.github.com/repos/AlexanderSher/RTVS/contents/{+path}","compare_url":"https://api.github.com/repos/AlexanderSher/RTVS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlexanderSher/RTVS/merges","archive_url":"https://api.github.com/repos/AlexanderSher/RTVS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlexanderSher/RTVS/downloads","issues_url":"https://api.github.com/repos/AlexanderSher/RTVS/issues{/number}","pulls_url":"https://api.github.com/repos/AlexanderSher/RTVS/pulls{/number}","milestones_url":"https://api.github.com/repos/AlexanderSher/RTVS/milestones{/number}","notifications_url":"https://api.github.com/repos/AlexanderSher/RTVS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlexanderSher/RTVS/labels{/name}","releases_url":"https://api.github.com/repos/AlexanderSher/RTVS/releases{/id}","deployments_url":"https://api.github.com/repos/AlexanderSher/RTVS/deployments","created_at":"2016-03-09T21:10:45Z","updated_at":"2016-03-09T21:10:54Z","pushed_at":"2016-05-26T07:09:40Z","git_url":"git://github.com/AlexanderSher/RTVS.git","ssh_url":"git@github.com:AlexanderSher/RTVS.git","clone_url":"https://github.com/AlexanderSher/RTVS.git","svn_url":"https://github.com/AlexanderSher/RTVS","homepage":null,"size":46562,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"8b690274825f1116444a463deecb6be8f0bff9db","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":38640473,"name":"RTVS","full_name":"Microsoft/RTVS","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/RTVS","description":"R Tools for Visual Studio.","fork":false,"url":"https://api.github.com/repos/Microsoft/RTVS","forks_url":"https://api.github.com/repos/Microsoft/RTVS/forks","keys_url":"https://api.github.com/repos/Microsoft/RTVS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/RTVS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/RTVS/teams","hooks_url":"https://api.github.com/repos/Microsoft/RTVS/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/RTVS/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/RTVS/events","assignees_url":"https://api.github.com/repos/Microsoft/RTVS/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/RTVS/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/RTVS/tags","blobs_url":"https://api.github.com/repos/Microsoft/RTVS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/RTVS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/RTVS/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/RTVS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/RTVS/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/RTVS/languages","stargazers_url":"https://api.github.com/repos/Microsoft/RTVS/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/RTVS/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/RTVS/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/RTVS/subscription","commits_url":"https://api.github.com/repos/Microsoft/RTVS/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/RTVS/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/RTVS/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/RTVS/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/RTVS/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/RTVS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/RTVS/merges","archive_url":"https://api.github.com/repos/Microsoft/RTVS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/RTVS/downloads","issues_url":"https://api.github.com/repos/Microsoft/RTVS/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/RTVS/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/RTVS/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/RTVS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/RTVS/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/RTVS/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/RTVS/deployments","created_at":"2015-07-06T19:14:09Z","updated_at":"2016-05-19T01:10:41Z","pushed_at":"2016-05-26T07:29:15Z","git_url":"git://github.com/Microsoft/RTVS.git","ssh_url":"git@github.com:Microsoft/RTVS.git","clone_url":"https://github.com/Microsoft/RTVS.git","svn_url":"https://github.com/Microsoft/RTVS","homepage":null,"size":47028,"stargazers_count":151,"watchers_count":151,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":37,"mirror_url":null,"open_issues_count":253,"forks":37,"open_issues":253,"watchers":151,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/RTVS/pulls/1821"},"html":{"href":"https://github.com/Microsoft/RTVS/pull/1821"},"issue":{"href":"https://api.github.com/repos/Microsoft/RTVS/issues/1821"},"comments":{"href":"https://api.github.com/repos/Microsoft/RTVS/issues/1821/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/RTVS/pulls/1821/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/RTVS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/RTVS/pulls/1821/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/RTVS/statuses/9799afe474df28a9aee9dceb5f1cc73e372cb802"}}}}
{"actor":{"display_login":"AlexanderSher"}}