diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1219.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1219.cs index 1565ad874..b8b14dbf3 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1219.cs +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1219.cs @@ -1,20 +1,36 @@ -using System; - -using Xamarin.Forms.CustomAttributes; +using Xamarin.Forms.CustomAttributes; using Xamarin.Forms.Internals; +#if UITEST +using NUnit.Framework; +using Xamarin.Forms.Core.UITests; +#endif + namespace Xamarin.Forms.Controls.Issues { [Preserve (AllMembers=true)] [Issue (IssueTracker.Github, 1219, "Setting ToolbarItems in ContentPage constructor crashes app", PlatformAffected.iOS)] - public class Issue1219 : ContentPage + public class Issue1219 : TestContentPage { + const string Success = "Success"; + public Issue1219 () { + Content = new Label { Text = Success }; + ToolbarItems.Add(new ToolbarItem ("MenuItem", "", () => { })); } - } -} + protected override void Init() { } +#if UITEST + [Test] + public void ViewCellInTableViewDoesNotCrash() + { + // If we can see this element, then we didn't crash. + RunningApp.WaitForElement(Success); + } +#endif + } +} \ No newline at end of file