2016-03-22 23:02:25 +03:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
using Xamarin.Forms.CustomAttributes;
|
2016-04-26 18:20:55 +03:00
|
|
|
|
using Xamarin.Forms.Internals;
|
2016-03-22 23:02:25 +03:00
|
|
|
|
#if UITEST
|
|
|
|
|
using Xamarin.UITest;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
#endif
|
|
|
|
|
|
2016-11-17 00:07:30 +03:00
|
|
|
|
namespace Xamarin.Forms.Controls.Issues
|
2016-03-22 23:02:25 +03:00
|
|
|
|
{
|
|
|
|
|
[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"));
|
|
|
|
|
}
|
2016-11-17 00:07:30 +03:00
|
|
|
|
|
|
|
|
|
[TearDown]
|
2019-03-27 21:38:38 +03:00
|
|
|
|
public override void TearDown()
|
2016-11-17 00:07:30 +03:00
|
|
|
|
{
|
|
|
|
|
RunningApp.SetOrientationPortrait ();
|
2019-03-27 21:38:38 +03:00
|
|
|
|
|
|
|
|
|
base.TearDown();
|
2016-11-17 00:07:30 +03:00
|
|
|
|
}
|
2016-03-22 23:02:25 +03:00
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
}
|