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:45:50 +0000
commit78df8b9f54593dac1a3d5c766ee11fd59bbae350 (patch)
treec6dd24b1602fdacb94c30589fb1908a71ba4ec09 /Xamarin.Forms.Controls.Issues
parentdbe0d4945da400a5b00599155d22cda78754294a (diff)
downloadxamarin-forms-78df8b9f54593dac1a3d5c766ee11fd59bbae350.tar.gz
xamarin-forms-78df8b9f54593dac1a3d5c766ee11fd59bbae350.tar.bz2
xamarin-forms-78df8b9f54593dac1a3d5c766ee11fd59bbae350.zip
[Android] Don't crash if Control is accessed in Effect OnDetached when Page is Disposed. (#772)
* 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.projitems2
2 files changed, 58 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 ba7de6cb..b3591792 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
@@ -223,6 +223,8 @@
<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" />
<Compile Include="$(MSBuildThisFileDirectory)Issue1075.cs" />