This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
607 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue8145.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
using Xamarin.Forms.Controls; | ||
|
||
#if UITEST | ||
using Xamarin.Forms.Core.UITests; | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
#if UITEST | ||
[Category(UITestCategories.Shell)] | ||
#endif | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 8145, "Shell System.ObjectDisposedException: 'Cannot access a disposed object. Object name: 'Android.Support.Design.Widget.BottomSheetDialog'.'", PlatformAffected.Android)] | ||
public class Issue8145 : TestShell | ||
{ | ||
string _titleElement = "Connect"; | ||
protected override void Init() | ||
{ | ||
Title = "Shell"; | ||
Items.Add(new FlyoutItem | ||
{ | ||
Title = _titleElement, | ||
Items = { | ||
new Tab { | ||
Title = "notme", | ||
Items = { | ||
new ContentPage { Title = "notme", Content = new Label { Text = "Click More, then choose the target. If it does not crash, this test has passed." } } | ||
} | ||
},new Tab { | ||
Title = "notme", | ||
Items = { | ||
new ContentPage { Title = "notme", Content = new Label { Text = "Click More, then choose the target. If it does not crash, this test has passed." } } | ||
} | ||
},new Tab { | ||
Title = "notme", | ||
Items = { | ||
new ContentPage { Title = "notme", Content = new Label { Text = "Click More, then choose the target. If it does not crash, this test has passed." } } | ||
} | ||
},new Tab { | ||
Title = "notme", | ||
Items = { | ||
new ContentPage { Title = "notme", Content = new Label { Text = "Click More, then choose the target. If it does not crash, this test has passed." } } | ||
} | ||
},new Tab { | ||
Title = "notme", | ||
Items = { | ||
new ContentPage { Title = "notme", Content = new Label { Text = "Click More, then choose the target. If it does not crash, this test has passed." } } | ||
} | ||
},new Tab { | ||
Title = "notme", | ||
Items = { | ||
new ContentPage { Title = "notme", Content = new Label { Text = "Click More, then choose the target. If it does not crash, this test has passed." } } | ||
} | ||
},new Tab { | ||
Title = "notme", | ||
Items = { | ||
new ContentPage { Title = "notme", Content = new Label { Text = "Click More, then choose the target. If it does not crash, this test has passed." } } | ||
} | ||
},new Tab { | ||
Title = "notme", | ||
Items = { | ||
new ContentPage { Title = "notme", Content = new Label { Text = "Click More, then choose the target. If it does not crash, this test has passed." } } | ||
} | ||
}, | ||
new Tab { | ||
Title = "target", | ||
Items = { | ||
new ContentPage { Title = "Target", Content = new Label { Text = "Success" } } | ||
} | ||
} | ||
} | ||
}); | ||
} | ||
|
||
#if UITEST | ||
#if !(__ANDROID__ || __IOS__) | ||
[Ignore("Shell test is only supported on Android and iOS")] | ||
#endif | ||
[Test] | ||
public void Issue8145ShellToolbarDisposedException() | ||
{ | ||
RunningApp.WaitForElement("More"); | ||
RunningApp.Tap("More"); | ||
RunningApp.WaitForElement("target"); | ||
RunningApp.Tap("target"); | ||
RunningApp.WaitForElement("Success"); | ||
} | ||
#endif | ||
} | ||
} |
80 changes: 80 additions & 0 deletions
80
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue8186.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Text; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
|
||
#if UITEST | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
using Xamarin.Forms.Core.UITests; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 8186, "[UWP] Setting IsRefreshing from OnAppearing on RefreshView crashes UWP", | ||
PlatformAffected.UWP)] | ||
#if UITEST | ||
[NUnit.Framework.Category(UITestCategories.RefreshView)] | ||
#endif | ||
public class Issue8186 : TestNavigationPage | ||
{ | ||
RefreshView _refreshView; | ||
protected override void Init() | ||
{ | ||
_refreshView = new RefreshView() | ||
{ | ||
Content = new ScrollView() | ||
{ | ||
Content = new StackLayout() | ||
{ | ||
Children = | ||
{ | ||
new Label() | ||
{ | ||
Text = "If you are reading this and see a refresh circle test has succeeded", | ||
AutomationId = "Success" | ||
}, | ||
new Button() | ||
{ | ||
Text = "Push Page then return to this page.", | ||
Command = new Command(() => | ||
{ | ||
Navigation.PushAsync(new ContentPage() | ||
{ | ||
Content = new Button() | ||
{ | ||
Text = "Pop Page", | ||
AutomationId = "PopPage", | ||
Command = new Command(()=> Navigation.PopAsync()) | ||
} | ||
}); | ||
}), | ||
AutomationId = "PushPage" | ||
} | ||
} | ||
} | ||
} | ||
}; | ||
|
||
var page = new ContentPage() { Content = _refreshView }; | ||
page.Appearing += (_, __) => _refreshView.IsRefreshing = true; | ||
page.Disappearing += (_, __) => _refreshView.IsRefreshing = false; | ||
PushAsync(page); | ||
} | ||
|
||
#if UITEST | ||
[Test] | ||
public void SetIsRefreshingToTrueInOnAppearingDoesntCrash() | ||
{ | ||
RunningApp.WaitForElement("Success"); | ||
RunningApp.Tap("PushPage"); | ||
RunningApp.Tap("PopPage"); | ||
RunningApp.WaitForElement("Success"); | ||
} | ||
#endif | ||
} | ||
} |
95 changes: 95 additions & 0 deletions
95
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/ShellAppearanceChange.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
using System.Linq; | ||
|
||
|
||
#if UITEST | ||
using Xamarin.Forms.Core.UITests; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.None, 0, "Shell AppearanceChange", | ||
PlatformAffected.All)] | ||
#if UITEST | ||
[NUnit.Framework.Category(UITestCategories.Shell)] | ||
[NUnit.Framework.Category(UITestCategories.ManualReview)] | ||
#endif | ||
public class ShellAppearanceChangeTests : TestShell | ||
{ | ||
protected override void Init() | ||
{ | ||
AddContentPage(GetContentPage(Color.Red)); | ||
} | ||
|
||
ContentPage GetContentPage(Color color) | ||
{ | ||
var stackLayout = new StackLayout() | ||
{ | ||
Children = | ||
{ | ||
new Label() { Text = $"I should have a {color} background"}, | ||
new Button() | ||
{ | ||
Text = "Push Purple Page", | ||
Command = new Command(() => | ||
{ | ||
var contentPage = GetContentPage(Color.Purple); | ||
Navigation.PushAsync(contentPage); | ||
}), | ||
}, | ||
} | ||
}; | ||
|
||
if (Navigation?.NavigationStack != null) | ||
{ | ||
stackLayout.Children.Add(new Button() | ||
{ | ||
Text = "Insert Orange Page Before Current Page", | ||
Command = new Command(() => | ||
{ | ||
var contentPage = GetContentPage(Color.Orange); | ||
Navigation.InsertPageBefore(contentPage, Navigation.NavigationStack.Last()); | ||
}), | ||
}); | ||
|
||
stackLayout.Children.Add(new Button() | ||
{ | ||
Text = "Pop Page", | ||
Command = new Command(() => | ||
{ | ||
Navigation.PopAsync(); | ||
}), | ||
}); | ||
|
||
stackLayout.Children.Add(new Button() | ||
{ | ||
Text = "Remove Current Page", | ||
Command = new Command(() => | ||
{ | ||
Navigation.RemovePage(Navigation.NavigationStack.Last()); | ||
}), | ||
}); | ||
|
||
stackLayout.Children.Add(new Button() | ||
{ | ||
Text = "Pop To Root", | ||
Command = new Command(() => | ||
{ | ||
Navigation.PopToRootAsync(); | ||
}), | ||
}); | ||
} | ||
|
||
var page = new ContentPage() | ||
{ | ||
Title = color.ToString(), | ||
Content = stackLayout | ||
}; | ||
|
||
Shell.SetBackgroundColor(page, color); | ||
return page; | ||
} | ||
} | ||
} |
Oops, something went wrong.