diff options
author | E.Z. Hart <hartez@users.noreply.github.com> | 2017-06-23 18:29:38 -0600 |
---|---|---|
committer | Rui Marinho <me@ruimarinho.net> | 2017-06-26 16:46:19 +0100 |
commit | 96aa74d0f2684db2e6043072f4d2ae968e7a2cf1 (patch) | |
tree | f7f2bb525d7601a18c5782f68a988cb075541ce2 /Xamarin.Forms.Controls.Issues | |
parent | aa9bca1341d4233a0fb3428968d31531c371d834 (diff) | |
download | xamarin-forms-96aa74d0f2684db2e6043072f4d2ae968e7a2cf1.tar.gz xamarin-forms-96aa74d0f2684db2e6043072f4d2ae968e7a2cf1.tar.bz2 xamarin-forms-96aa74d0f2684db2e6043072f4d2ae968e7a2cf1.zip |
Fix NRE when background color of button set in FormsApplicationActivity (#1010)
Diffstat (limited to 'Xamarin.Forms.Controls.Issues')
2 files changed, 47 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/ButtonBackgroundColorTest.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/ButtonBackgroundColorTest.cs new file mode 100644 index 00000000..b366efce --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/ButtonBackgroundColorTest.cs @@ -0,0 +1,46 @@ +using Xamarin.Forms.CustomAttributes; +using Xamarin.Forms.Internals; + +#if UITEST +using Xamarin.Forms.Core.UITests; +using Xamarin.UITest; +using NUnit.Framework; + +#endif + +namespace Xamarin.Forms.Controls.Issues +{ +#if UITEST + [Category(UITestCategories.Button)] +#endif + + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 57717, "Setting background color on Button in Android FormsApplicationActivity causes NRE", PlatformAffected.Android)] + public class ButtonBackgroundColorTest : TestContentPage + { + const string ButtonText = "I am a button"; + + protected override void Init() + { + var layout = new StackLayout(); + + var instructions = new Label { Text = "If you can see this, the test has passed." }; + + var button = new Button { Text = ButtonText, BackgroundColor = Color.CornflowerBlue }; + + layout.Children.Add(instructions); + layout.Children.Add(button); + + Content = layout; + } + +#if UITEST + [Test] + public void ButtonBackgroundColorAutomatedTest() + { + // With the original bug in place, we'll crash before we get this far + RunningApp.WaitForElement(ButtonText); + } +#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 a2eb070f..ec6439e3 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 @@ -197,6 +197,7 @@ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla52266.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla53445.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla55912.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)ButtonBackgroundColorTest.cs" /> <Compile Include="$(MSBuildThisFileDirectory)CarouselAsync.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla34561.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla34727.cs" /> |