diff options
Diffstat (limited to 'Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla45743.cs')
-rw-r--r-- | Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla45743.cs | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla45743.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla45743.cs new file mode 100644 index 00000000..46b9c22d --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla45743.cs @@ -0,0 +1,78 @@ +using Xamarin.Forms.CustomAttributes; +using Xamarin.Forms.Internals; + +#if UITEST +using Xamarin.UITest; +using NUnit.Framework; +#endif + +namespace Xamarin.Forms.Controls.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 45743, "[iOS] Calling DisplayAlert via BeginInvokeOnMainThread blocking other calls on iOS", PlatformAffected.iOS)] + public class Bugzilla45743 : TestNavigationPage + { + protected override void Init() + { + PushAsync(new ContentPage + { + Content = new StackLayout + { + AutomationId = "Page1", + Children = + { + new Label { Text = "Page 1" } + } + } + }); + + Device.BeginInvokeOnMainThread(async () => + { + await DisplayAlert("Title", "Message", "Accept", "Cancel"); + }); + + Device.BeginInvokeOnMainThread(async () => + { + await PushAsync(new ContentPage + { + AutomationId = "Page2", + Content = new StackLayout + { + Children = + { + new Label { Text = "Page 2" } + } + } + }); + }); + + Device.BeginInvokeOnMainThread(async () => + { + await DisplayAlert("Title 2", "Message", "Accept", "Cancel"); + }); + + Device.BeginInvokeOnMainThread(async () => + { + await DisplayActionSheet("ActionSheet Title", "Cancel", "Close", new string[] { "Test", "Test 2" }); + }); + } + +#if UITEST + +#if __IOS__ + [Test] + public void Bugzilla45743Test() + { + RunningApp.WaitForElement(q => q.Marked("ActionSheet Title")); + RunningApp.Tap("Close"); + RunningApp.WaitForElement(q => q.Marked("Title 2")); + RunningApp.Tap("Accept"); + RunningApp.WaitForElement(q => q.Marked("Title")); + RunningApp.Tap("Accept"); + Assert.True(RunningApp.Query(q => q.Text("Page 2")).Length > 0); + } +#endif + +#endif + } +}
\ No newline at end of file |