diff options
author | Paul DiPietro <pauldipietro@users.noreply.github.com> | 2016-11-15 13:36:49 -0600 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2016-11-15 11:36:49 -0800 |
commit | 7f9f2530ca1912421e0d88cd47f185dc733cd310 (patch) | |
tree | b2635e0df15f21e26b6f101518d078c7af7d14e7 /Xamarin.Forms.Controls.Issues | |
parent | 04cc360a39505877717d5309d9649422e602c021 (diff) | |
download | xamarin-forms-7f9f2530ca1912421e0d88cd47f185dc733cd310.tar.gz xamarin-forms-7f9f2530ca1912421e0d88cd47f185dc733cd310.tar.bz2 xamarin-forms-7f9f2530ca1912421e0d88cd47f185dc733cd310.zip |
[iOS] Use separate UIWindow for UIAlertController (#481)
* [iOS] Use separate UIWindow for UIAlertController
* Add similar behavior for DisplayActionSheet; consolidate behavior into PresentAlert method
Diffstat (limited to 'Xamarin.Forms.Controls.Issues')
2 files changed, 79 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 diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems index 677ddb9f..263feb5d 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems @@ -133,6 +133,7 @@ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla42832.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla44044.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla44338.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Bugzilla45743.cs" /> <Compile Include="$(MSBuildThisFileDirectory)CarouselAsync.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla34561.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla34727.cs" /> |