summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues
diff options
context:
space:
mode:
authorE.Z. Hart <hartez@users.noreply.github.com>2017-09-21 17:42:43 (GMT)
committerJason Smith <jason.smith@xamarin.com>2017-09-28 21:59:12 (GMT)
commit8ff07402ecdd3ebc8bde30942be48e4c95ed4a01 (patch)
tree3224d7a0b68607e0cd45e260f7381f279d9da9c2 /Xamarin.Forms.Controls.Issues
parent4382364030f2b54ab1a72f1b36aee98801cdc257 (diff)
downloadxamarin-forms-8ff07402ecdd3ebc8bde30942be48e4c95ed4a01.zip
xamarin-forms-8ff07402ecdd3ebc8bde30942be48e4c95ed4a01.tar.gz
xamarin-forms-8ff07402ecdd3ebc8bde30942be48e4c95ed4a01.tar.bz2
Prevent Flags/IsInitialized check from crashing Android app on restart (#1151)
* Prevent Android app crashes on configuration restarts when flags are set * Update UI test * Fix typos * Don't prevent FastRenderers flag from being set
Diffstat (limited to 'Xamarin.Forms.Controls.Issues')
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/RestartAppTest.cs47
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems1
2 files changed, 48 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/RestartAppTest.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/RestartAppTest.cs
new file mode 100644
index 0000000..85bd841
--- /dev/null
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/RestartAppTest.cs
@@ -0,0 +1,47 @@
+´╗┐using Xamarin.Forms.CustomAttributes;
+using Xamarin.Forms.Internals;
+
+#if UITEST
+using Xamarin.UITest;
+using NUnit.Framework;
+using Xamarin.Forms.Core.UITests;
+#endif
+
+namespace Xamarin.Forms.Controls.Issues
+{
+#if UITEST
+ [Category(UITestCategories.LifeCycle)]
+#endif
+
+ [Preserve(AllMembers = true)]
+ [Issue(IssueTracker.None, 11, "Config changes which restart the app should not crash",
+ PlatformAffected.Android)]
+ public class RestartAppTest : TestContentPage
+ {
+ public const string ForceRestart = "ForceRestart";
+ public const string Success = "Success";
+
+ protected override void Init()
+ {
+ Content = new StackLayout
+ {
+ Padding = new Thickness(0, 20, 0, 0),
+ Children =
+ {
+ new Label { Text = Success }
+ }
+ };
+
+ MessagingCenter.Send(this, ForceRestart);
+ }
+
+#if UITEST
+ [Test]
+ public void ForcingRestartDoesNotCauseCrash()
+ {
+ // If the app hasn't crashed, this test has passed
+ RunningApp.WaitForElement(Success);
+ }
+#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 5055f95..8bc0435 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
@@ -279,6 +279,7 @@
<SubType>Code</SubType>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)PopAfterRemove.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)RestartAppTest.cs" />
<Compile Include="$(MSBuildThisFileDirectory)TestPages\ScreenshotConditionalApp.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla41842.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla42277.cs" />