summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues
diff options
context:
space:
mode:
authorSamantha Houts <samantha@teamredwall.com>2017-03-03 04:41:04 -0800
committerRui Marinho <me@ruimarinho.net>2017-03-03 12:41:04 +0000
commitbc13d3cfeeea62214f0c6f434e5f21f7117e2e1a (patch)
tree5d2e471468e8f754e8e445d2588b0b5fc4508a3c /Xamarin.Forms.Controls.Issues
parent8871077f115e7ef4d15efaa418fd718089db42c7 (diff)
downloadxamarin-forms-bc13d3cfeeea62214f0c6f434e5f21f7117e2e1a.tar.gz
xamarin-forms-bc13d3cfeeea62214f0c6f434e5f21f7117e2e1a.tar.bz2
xamarin-forms-bc13d3cfeeea62214f0c6f434e5f21f7117e2e1a.zip
[Android] Don't crash if Control is accessed in Effect OnDetached when Page is Disposed. (#773)
* Add repro for 51505 * [Android] Don't dispose of EffectControlProvider * Oops
Diffstat (limited to 'Xamarin.Forms.Controls.Issues')
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla51505.cs56
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems1
2 files changed, 57 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla51505.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla51505.cs
new file mode 100644
index 00000000..2851009e
--- /dev/null
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla51505.cs
@@ -0,0 +1,56 @@
+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.Bugzilla, 51505, "ObjectDisposedException On Effect detachment.", PlatformAffected.Android)]
+ public class Bugzilla51505 : TestContentPage
+ {
+ const string ButtonId = "button";
+
+ protected override void Init()
+ {
+ var effect = Effect.Resolve("XamControl.BorderEffect");
+
+ var button = new Button { Text = "Click me", AutomationId = ButtonId };
+ button.Clicked += async (sender, e) =>
+ {
+ await Navigation.PopAsync();
+ };
+ button.Effects.Add(effect);
+
+ Content = new StackLayout
+ {
+ Children =
+ {
+ new Label
+ {
+ Text = "The following Button has an Effect applied to it that should attempt to access the Control when it is Detached. When you click the Button, this page should be popped. If the app crashes, this test has failed."
+ },
+ button
+ }
+ };
+ }
+
+#if UITEST
+ [Test]
+ public void Bugzilla51505Test()
+ {
+ RunningApp.WaitForElement(q => q.Marked(ButtonId));
+ Assert.DoesNotThrow(() => RunningApp.Tap(q => q.Marked(ButtonId)), "Accessing the Control when an Effect is detached should not throw");
+ }
+#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 0deca6b6..72c310fc 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
@@ -247,6 +247,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla37431.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla44777.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla51503.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla51505.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla52533.cs" />
<Compile Include="$(MSBuildThisFileDirectory)_Template.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue1028.cs" />