Merge branch '4.0.0' into 4.1.0

This commit is contained in:
Samantha Houts 2019-07-03 16:42:03 -07:00
Родитель 7a1434b747 ebad51173b
Коммит 1707f56d7e
11 изменённых файлов: 33 добавлений и 29 удалений

Просмотреть файл

@ -15,6 +15,7 @@ namespace Xamarin.Forms.Controls.Issues
[Issue(IssueTracker.Bugzilla, 30353, "MasterDetailPage.IsPresentedChanged is not raised")] [Issue(IssueTracker.Bugzilla, 30353, "MasterDetailPage.IsPresentedChanged is not raised")]
#if UITEST #if UITEST
[Category(UITestCategories.UwpIgnore)] [Category(UITestCategories.UwpIgnore)]
[Category(UITestCategories.MasterDetailPage)]
#endif #endif
public class Bugzilla30353 : TestMasterDetailPage public class Bugzilla30353 : TestMasterDetailPage
{ {
@ -78,7 +79,7 @@ namespace Xamarin.Forms.Controls.Issues
#if UITEST #if UITEST
[Test] [Test]
public void Bugzilla30353Test () public void MasterDetailPageIsPresentedChangedRaised()
{ {
var dontRun = RunningApp.Query (q => q.Marked ("Don't run")); var dontRun = RunningApp.Query (q => q.Marked ("Don't run"));
if (dontRun.Length > 0) if (dontRun.Length > 0)

Просмотреть файл

@ -76,7 +76,7 @@ namespace Xamarin.Forms.Controls.Issues
#if UITEST && __IOS__ #if UITEST && __IOS__
[Test] [Test]
public void Bugzilla33578Test () public void TableViewEntryCellShowsDefaultKeyboardThenNumericKeyboardAfterScrolling()
{ {
RunningApp.ScrollDown (); RunningApp.ScrollDown ();
RunningApp.ScrollDown (); RunningApp.ScrollDown ();

Просмотреть файл

@ -296,7 +296,7 @@ namespace Xamarin.Forms.Controls.Issues
} }
[Test] [Test]
public void Issue42620Test() public void GridChildrenAddHorizontalDoesNotSpanAllRows()
{ {
Issue42620Test("RCRHVHVHVHVHV"); Issue42620Test("RCRHVHVHVHVHV");

Просмотреть файл

@ -9,18 +9,21 @@ using System.Diagnostics;
#if UITEST #if UITEST
using Xamarin.UITest; using Xamarin.UITest;
using NUnit.Framework; using NUnit.Framework;
using Xamarin.Forms.Core.UITests;
#endif #endif
namespace Xamarin.Forms.Controls.Issues namespace Xamarin.Forms.Controls.Issues
{ {
#if UITEST #if UITEST
[NUnit.Framework.Category(Core.UITests.UITestCategories.UwpIgnore)] [NUnit.Framework.Category(Core.UITests.UITestCategories.UwpIgnore)]
[NUnit.Framework.Category(Core.UITests.UITestCategories.ListView)]
#endif #endif
[Preserve(AllMembers = true)] [Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 56896, "ListViews for lists with many elements regressed in performance on iOS", PlatformAffected.iOS)] [Issue(IssueTracker.Bugzilla, 56896, "ListViews for lists with many elements regressed in performance on iOS", PlatformAffected.iOS)]
public class Bugzilla56896 : TestContentPage public class Bugzilla56896 : TestContentPage
{ {
const string Instructions = "The number in blue is the number of constructor calls. The number in red is the initial load time in milliseconds."; const string Instructions = "The number in blue is the number of constructor calls. The number in purple is the initial load time in milliseconds.";
const string InstructionsId = "InstructionsId";
const string ConstructorCountId = "constructorCount"; const string ConstructorCountId = "constructorCount";
const string TimeId = "time"; const string TimeId = "time";
@ -196,11 +199,11 @@ namespace Xamarin.Forms.Controls.Issues
// Also note that performance will degrade if the first cell does not have a specified height or // Also note that performance will degrade if the first cell does not have a specified height or
// if most of the cells do not have a specified height. It is recommended to specify a height on all // if most of the cells do not have a specified height. It is recommended to specify a height on all
// or none of the cells when possible. // or none of the cells when possible.
RowHeight = 50, RowHeight = 50,
ItemsSource = Enumerable.Range(1, 5001), ItemsSource = Enumerable.Range(1, 5001),
ItemTemplate = new MyDataTemplateSelector(vm) ItemTemplate = new MyDataTemplateSelector(vm)
}; };
Content = new StackLayout { Children = { new Label { Text = Instructions }, label, _timeLabel, _listView } }; Content = new StackLayout { Children = { new Label { Text = Instructions, AutomationId = InstructionsId }, label, _timeLabel, _listView } };
} }
protected override void OnAppearing() protected override void OnAppearing()
@ -214,14 +217,14 @@ namespace Xamarin.Forms.Controls.Issues
#if UITEST #if UITEST
[Test] [Test]
public void Bugzilla56896Test() public void ListViewsWithManyElementsPerformanceCheck()
{ {
RunningApp.WaitForElement(q => q.Marked(Instructions)); RunningApp.WaitForElement(q => q.Marked(Instructions));
RunningApp.WaitForElement(q => q.Marked(ConstructorCountId)); RunningApp.WaitForElement(q => q.Marked(ConstructorCountId));
RunningApp.WaitForElement(q => q.Marked(TimeId)); RunningApp.WaitForElement(q => q.Marked(TimeId));
var count = int.Parse(RunningApp.Query(q => q.Marked(ConstructorCountId))[0].Text); var count = int.Parse(RunningApp.WaitForElement(q => q.Marked(ConstructorCountId))[0].Text);
Assert.IsTrue(count < 100); // Failing test makes ~15000 constructor calls Assert.IsTrue(count < 100); // Failing test makes ~15000 constructor calls
var time = int.Parse(RunningApp.Query(q => q.Marked(TimeId))[0].Text); var time = int.Parse(RunningApp.WaitForElement(q => q.Marked(TimeId))[0].Text);
Assert.IsTrue(count < 2000); // Failing test takes ~4000ms Assert.IsTrue(count < 2000); // Failing test takes ~4000ms
} }
#endif #endif

Просмотреть файл

@ -40,7 +40,7 @@ namespace Xamarin.Forms.Controls.Issues
#if UITEST #if UITEST
[Test] [Test]
public void Issue59580Test() public void RaisingCommandCanExecuteChangedCausesCrashOnAndroid()
{ {
RunningApp.WaitForElement(c => c.Marked("Cell")); RunningApp.WaitForElement(c => c.Marked("Cell"));

Просмотреть файл

@ -76,12 +76,10 @@ namespace Xamarin.Forms.Controls.Issues
#if UITEST #if UITEST
[Test] [Test]
public void Issue1414Test() public void InvalidCastExceptionWhenScrollingAndRefreshingTableView()
{ {
RunningApp.Screenshot("Start G1414"); RunningApp.Screenshot("Start G1414");
RunningApp.WaitForElement(q => q.Marked("TableView")); var tableFrame = RunningApp.WaitForElement(q => q.Marked("TableView"))[0].Rect;
var tableFrame = RunningApp.Query(q => q.Marked("TableView"))[0].Rect;
RunningApp.ScrollForElement("* marked:'Row-4-24'", new Drag(tableFrame, Drag.Direction.BottomToTop, Drag.DragLength.Long)); RunningApp.ScrollForElement("* marked:'Row-4-24'", new Drag(tableFrame, Drag.Direction.BottomToTop, Drag.DragLength.Long));
RunningApp.Screenshot("Scrolled to end without crashing!"); RunningApp.Screenshot("Scrolled to end without crashing!");
RunningApp.ScrollForElement("* marked:'Row-0-0'", new Drag(tableFrame, Drag.Direction.TopToBottom, Drag.DragLength.Long)); RunningApp.ScrollForElement("* marked:'Row-0-0'", new Drag(tableFrame, Drag.Direction.TopToBottom, Drag.DragLength.Long));

Просмотреть файл

@ -13,8 +13,8 @@ namespace Xamarin.Forms.Core.UITests
public static AppResult[] RetryUntilPresent( public static AppResult[] RetryUntilPresent(
this IApp app, this IApp app,
Func<AppResult[]> func, Func<AppResult[]> func,
int retryCount, int retryCount = 10,
int delayInMs) int delayInMs = 2000)
{ {
var results = func(); var results = func();

Просмотреть файл

@ -64,15 +64,8 @@ namespace Xamarin.Forms.Platform.UWP
Color backgroundColor = Element.BackgroundColor; Color backgroundColor = Element.BackgroundColor;
if (Control != null) if (Control != null)
{ {
if (!backgroundColor.IsDefault) Control.Background = backgroundColor.IsDefault ? null : backgroundColor.ToBrush();
{ }
Control.Background = backgroundColor.ToBrush();
}
else
{
Control.ClearValue(BackgroundProperty);
}
}
} }
void PackChild() void PackChild()

Просмотреть файл

@ -271,7 +271,7 @@
</DataTemplate> </DataTemplate>
<DataTemplate x:Key="ImageCell"> <DataTemplate x:Key="ImageCell">
<Grid AutomationProperties.AutomationId="CoffeeAutomationId"> <Grid AutomationProperties.AutomationId="{Binding AutomationId}">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
<ColumnDefinition /> <ColumnDefinition />
@ -303,7 +303,7 @@
</DataTemplate> </DataTemplate>
<DataTemplate x:Key="SwitchCell"> <DataTemplate x:Key="SwitchCell">
<Grid HorizontalAlignment="Stretch" x:Name="ParentGrid" AutomationProperties.AutomationId="{Binding AutomationId}"> <Grid HorizontalAlignment="Stretch" x:Name="ParentGrid" AutomationProperties.AutomationId="{Binding AutomationId}">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />

Просмотреть файл

@ -6,11 +6,14 @@
// examples // examples
/* /*
Windows CMD:
build.cmd -Target NugetPack
build.cmd -Target NugetPack -ScriptArgs '-packageVersion="9.9.9-custom"'
PowerShell:
./build.ps1 -Target NugetPack ./build.ps1 -Target NugetPack
./build.ps1 -Target NugetPack -ScriptArgs '-packageVersion="9.9.9-custom"' ./build.ps1 -Target NugetPack -ScriptArgs '-packageVersion="9.9.9-custom"'
*/ */
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// ADDINS // ADDINS

6
build.cmd Normal file
Просмотреть файл

@ -0,0 +1,6 @@
@ECHO OFF
SETLOCAL
PowerShell -NoProfile -NoLogo -ExecutionPolicy Bypass -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; try { & '%~dp0build.ps1' %*; exit $LASTEXITCODE } catch { write-host $_; exit 1 }"
SET exit_code=%ERRORLEVEL%
ECHO build.cmd completed
EXIT /b %exit_code%