diff options
Diffstat (limited to 'Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26233.cs')
-rw-r--r-- | Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26233.cs | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26233.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26233.cs new file mode 100644 index 00000000..0a9f3fdc --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26233.cs @@ -0,0 +1,56 @@ +using System; + +using Xamarin.Forms.CustomAttributes; + +#if UITEST +using Xamarin.UITest; +using NUnit.Framework; +#endif + +namespace Xamarin.Forms.Controls +{ + [Preserve (AllMembers = true)] + [Issue (IssueTracker.Bugzilla, 26233, "Windows phone crashing when going back to page containing listview with Frame inside ViewCell")] + public class Bugzilla26233 : TestContentPage + { + protected override void Init () + { + var listview = new ListView (); + listview.ItemTemplate = new DataTemplate (typeof (ItemTemplate)); + listview.ItemsSource = new string[] { "item", "item", "item", "item", "item" }; + var btnBack = new Button { Text = "back", Command = new Command (() => Navigation.PopAsync ()) }; + listview.ItemSelected += (s, e) => Navigation.PushAsync (new ContentPage { Content = btnBack }); + var btnPush = new Button { + Text = "Next", + AutomationId = "btnPush", + Command = new Command (() => Navigation.PushAsync (new ContentPage { Content = btnBack })) + }; + + Content = new StackLayout { Children = { btnPush, listview } }; + } + + [Preserve (AllMembers = true)] + internal class ItemTemplate : ViewCell + { + public ItemTemplate () + { + var frame = new Frame (); + frame.Content = new StackLayout { Children = { new Label { Text = "hello 1" } } }; + View = frame; + } + } + +#if UITEST + [Test] + public void DoesntCrashOnNavigatingBackToThePage () + { + RunningApp.WaitForElement (q => q.Marked ("btnPush")); + RunningApp.Tap (q => q.Marked ("btnPush")); + RunningApp.WaitForElement (q => q.Marked ("back")); + RunningApp.Screenshot ("I see the back button"); + RunningApp.Tap (q => q.Marked ("back")); + RunningApp.WaitForElement (q => q.Marked ("btnPush")); + } +#endif + } +} |