summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues
diff options
context:
space:
mode:
authorRui Marinho <me@ruimarinho.net>2017-09-01 15:22:28 (GMT)
committerSamantha Houts <samantha.houts@xamarin.com>2017-09-15 00:53:55 (GMT)
commit35375bc2dc217fe93efc446a82fb6c111d05aa8e (patch)
tree830b373fd7debf7486ae33b8397798d5e1131e1c /Xamarin.Forms.Controls.Issues
parentc2f6a9c16c06b50c2795a6e57a6ae77b2d7291d1 (diff)
downloadxamarin-forms-35375bc2dc217fe93efc446a82fb6c111d05aa8e.zip
xamarin-forms-35375bc2dc217fe93efc446a82fb6c111d05aa8e.tar.gz
xamarin-forms-35375bc2dc217fe93efc446a82fb6c111d05aa8e.tar.bz2
[Android] Fix NRE when page is being disposed (#1118)
* [ControlGallery] Add test case for bugzilla 59097 * [Android] Fix NRE
Diffstat (limited to 'Xamarin.Forms.Controls.Issues')
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla59097.cs49
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems1
2 files changed, 50 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla59097.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla59097.cs
new file mode 100644
index 0000000..304a52d
--- /dev/null
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla59097.cs
@@ -0,0 +1,49 @@
+´╗┐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, 59097, "[Android] Calling PopAsync via TapGestureRecognizer causes an application crash", PlatformAffected.Android)]
+ public class Bugzilla59097 : TestNavigationPage // or TestMasterDetailPage, etc ...
+ {
+ protected override void Init()
+ {
+ Navigation.PushAsync(new ContentPage { Content = new Label { Text = "previous page " } });
+ Navigation.PushAsync(new ToPopPage());
+ }
+
+ public class ToPopPage : ContentPage
+ {
+ public ToPopPage()
+ {
+ var boxView = new BoxView { WidthRequest = 100, HeightRequest = 100, Color = Color.Red, AutomationId = "boxView" };
+ var tapGesture = new TapGestureRecognizer { NumberOfTapsRequired = 1, Command = new Command(PopPageBack) };
+ boxView.GestureRecognizers.Add(tapGesture);
+ var layout = new StackLayout();
+ layout.Children.Add(boxView);
+ Content = layout;
+ }
+
+ async void PopPageBack(object obj)
+ {
+ await Navigation.PopAsync(true);
+ }
+ }
+
+
+#if UITEST
+ [Test]
+ public void Bugzilla59097Test()
+ {
+ RunningApp.WaitForElement(q => q.Marked("boxView"));
+ RunningApp.Tap(q => q.Marked("boxView"));
+ }
+#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 1274dd2..4f41a1f 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
@@ -318,6 +318,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Bugzila57749.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ScrollViewObjectDisposed.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla58645.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla59097.cs" />
<Compile Include="$(MSBuildThisFileDirectory)_Template.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla42620.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue1028.cs" />