summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla38658.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla38658.cs')
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla38658.cs74
1 files changed, 74 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla38658.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla38658.cs
new file mode 100644
index 00000000..b907a658
--- /dev/null
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla38658.cs
@@ -0,0 +1,74 @@
+´╗┐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, 38658, "Rotation causes app containing CarouselPage to freeze", PlatformAffected.iOS)]
+ public class Bugzilla38658 : TestTabbedPage // or TestMasterDetailPage, etc ...
+ {
+ public class TestCarouselPage : CarouselPage
+ {
+ public TestCarouselPage ()
+ {
+ Children.Add (new ContentPage () {
+ Content = new StackLayout {
+ Children = {
+ new Label { Text = "Rotate the device to Landscape and back to Portrait. If the app hangs, this test has failed." },
+ new BoxView { Color = Color.Red, HeightRequest = 200, WidthRequest = 200 }
+ }
+ }
+ });
+ Children.Add (new ContentPage () {
+ Content = new StackLayout {
+ Children = {
+ new Label { Text = "Rotate the device to Landscape and back to Portrait. If the app hangs, this test has failed." },
+ new BoxView { Color = Color.Green, HeightRequest = 200, WidthRequest = 200 }
+ }
+ }
+ });
+ }
+ }
+ public class StartPage : ContentPage
+ {
+ public StartPage ()
+ {
+ Button button = new Button {
+ AutomationId = "btn",
+ Text = "Click"
+ };
+ button.Clicked += button_Clicked;
+ Content = button;
+ }
+
+ async void button_Clicked (object sender, EventArgs e)
+ {
+ await Navigation.PushAsync (new TestCarouselPage ());
+ }
+ }
+
+ protected override void Init ()
+ {
+ Children.Add (new NavigationPage (new StartPage () { Title = "Page" }));
+ }
+
+#if UITEST
+ [Test]
+ public void Bugzilla38658Test ()
+ {
+ RunningApp.WaitForElement (q => q.Marked ("btn"));
+ RunningApp.Tap (q => q.Marked ("btn"));
+ RunningApp.SetOrientationLandscape ();
+ RunningApp.SetOrientationPortrait ();
+ RunningApp.Back ();
+ RunningApp.WaitForElement (q => q.Marked ("btn"));
+ }
+#endif
+ }
+} \ No newline at end of file