summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues
diff options
context:
space:
mode:
authorSamantha Houts <samhouts@users.noreply.github.com>2017-03-27 03:31:04 -0700
committerRui Marinho <me@ruimarinho.net>2017-03-27 11:31:04 +0100
commit1eae24b051061227347f592d092806cab12f31e6 (patch)
treef901d46fd2794ccab0319da2392879c43203071a /Xamarin.Forms.Controls.Issues
parent9dcce94937584e1ccbf52371736ee3b712f5107f (diff)
downloadxamarin-forms-1eae24b051061227347f592d092806cab12f31e6.tar.gz
xamarin-forms-1eae24b051061227347f592d092806cab12f31e6.tar.bz2
xamarin-forms-1eae24b051061227347f592d092806cab12f31e6.zip
[iOS] Prevent NRE when page is switched on Appearing (#840)
Diffstat (limited to 'Xamarin.Forms.Controls.Issues')
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Unreported1.cs55
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems1
2 files changed, 56 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Unreported1.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Unreported1.cs
new file mode 100644
index 00000000..2ed07cd8
--- /dev/null
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Unreported1.cs
@@ -0,0 +1,55 @@
+using Xamarin.Forms.CustomAttributes;
+using Xamarin.Forms.Internals;
+
+#if UITEST
+using Xamarin.UITest;
+using NUnit.Framework;
+#endif
+
+// Apply the default category of "Issues" to all of the tests in this assembly
+// We use this as a catch-all for tests which haven't been individually categorized
+#if UITEST
+[assembly: NUnit.Framework.Category("Issues")]
+#endif
+
+namespace Xamarin.Forms.Controls.Issues
+{
+ [Preserve(AllMembers = true)]
+ [Issue(IssueTracker.None, 0, "NRE when switching page on Appearing", PlatformAffected.iOS)]
+ public class Unreported1 : TestMasterDetailPage
+ {
+ static Unreported1 MDP;
+
+ class SplashPage : ContentPage
+ {
+ protected override void OnAppearing()
+ {
+ base.OnAppearing();
+
+ // You really shouldn't do this, but we shouldn't crash when you do it. :)
+ SwitchDetail();
+ }
+ }
+
+ protected override void Init()
+ {
+ MDP = this;
+
+ Master = new Page { Title = "Master" };
+ Detail = new SplashPage();
+ }
+
+ public static void SwitchDetail()
+ {
+ MDP.Detail = new ContentPage { Content = new Label { Text = "If this did not crash, this test has passed." }, Padding = 20 };
+ }
+
+#if UITEST
+ [Test]
+ public void Unreported1Test()
+ {
+ RunningApp.Screenshot("ensure there is no crash");
+ }
+#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 98753ff5..8608dc72 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
@@ -269,6 +269,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla52533.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla53362.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla45874.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Unreported1.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla53909.cs" />
<Compile Include="$(MSBuildThisFileDirectory)_Template.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue1028.cs" />