Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oct 14th Update #9

Merged
merged 17 commits into from
Oct 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,4 @@ caketools/
*.binlog
.ionide/**
/.nuspec
XamarinFormsVersionFile.txt
7 changes: 6 additions & 1 deletion Stubs/Xamarin.Forms.Platform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,13 @@ internal class _CarouselViewRenderer { }
[RenderWith (typeof (SliderRenderer))]
internal class _SliderRenderer { }

[RenderWith (typeof (WebViewRenderer))]
#if __IOS__
[RenderWith (typeof (WkWebViewRenderer))]
internal class _WebViewRenderer { }
#else
[RenderWith(typeof(WebViewRenderer))]
internal class _WebViewRenderer { }
#endif

[RenderWith (typeof (SearchBarRenderer))]
internal class _SearchBarRenderer { }
Expand Down
7 changes: 7 additions & 0 deletions Version.targets
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@
</ItemGroup>

<Message Condition="$(CI) and '$(BUILD_REASON)' == 'Schedule'" Importance="high" Text="##vso[build.addbuildtag]$(NightlyTag)"/>
<ItemGroup>
<XamarinFormsVersionFile Include="../XamarinFormsVersionFile.txt"/>
<XamarinFormsVersionLine Include="$(PackageVersion)"/>
</ItemGroup>

<!-- Occasionally this throws an error from parallel builds writing to this file. It's fine if only one of them wins. -->
<WriteLinesToFile ContinueOnError="WarnAndContinue" File="@(XamarinFormsVersionFile)" Lines="@(XamarinFormsVersionLine)" Overwrite="true" />
<Message Condition="$(CI)" Importance="high" Text="##vso[build.updatebuildnumber]$(PackageVersion)"/>
<Message Condition="$(CI)" Importance="high" Text="##vso[task.setvariable variable=XamarinFormsPackageVersion;isOutput=true;]$(PackageVersion)"/>
</Target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ protected override void Dispose(bool disposing)
}
}

public class PerformanceTrackingWebView : WebViewRenderer, IDrawnObservable
public class PerformanceTrackingWebView : WkWebViewRenderer, IDrawnObservable
{
readonly SubviewWatcher<PerformanceTrackingWebView> _watcher;
int _Drawn;
Expand Down
2 changes: 1 addition & 1 deletion Xamarin.Forms.ControlGallery.iOS/local.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<body>
<h1 id="#LocalHtmlPage">Xamarin.Forms</h1>
<p>This is a local iOS Html page</p>
<a href="https://www.google.com">Go to Google</a>
<a id="#LocalHtmlPageLink" href="https://www.google.com">Go to Google</a>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Xamarin.Forms.CustomAttributes;
using System.Collections.Generic;
using Xamarin.Forms.Internals;
using System.Linq;
#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
Expand Down Expand Up @@ -101,19 +102,33 @@ public void Bugzilla26993Test()
{
RunningApp.Screenshot("I am at BZ26993");

#if __IOS__
RunningApp.WaitForElement(q => q.Class("WKWebView"), postTimeout: TimeSpan.FromSeconds(5));

RunningApp.Query(q => q.Class("WKWebView").Index(0).InvokeJS("document.getElementById('LinkID0').click()"));
RunningApp.Screenshot("Load local HTML");

RunningApp.WaitForNoElement(q => q.Class("WKWebView").Css("#LinkID0"));
UITest.Queries.AppWebResult[] newElem =
RunningApp.QueryUntilPresent(() => RunningApp.Query(q => q.Class("WKWebView").Css("a")));

Assert.AreEqual("#LocalHtmlPageLink", newElem[0].Id);
#elif __ANDROID__
RunningApp.WaitForElement(q => q.WebView(0).Css("#CellID0"));
RunningApp.Tap(q => q.WebView(0).Css("#LinkID0"));

RunningApp.Screenshot("Load local HTML");

RunningApp.WaitForNoElement(q => q.WebView(0).Css("#LinkID0"));

UITest.Queries.AppWebResult[] newElem =
RunningApp.QueryUntilPresent(() => RunningApp.Query(q => q.WebView(0).Css("h1")));

Assert.AreEqual("#LocalHtmlPage", newElem[0].Id);
#endif

RunningApp.Screenshot("I see the Label");
}
#endif
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
using System;

#if UITEST
using Xamarin.UITest;
using Xamarin.Forms.Core.UITests;
using NUnit.Framework;
#endif

namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.Shell)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 4756, "Cannot prevent flyout menu list from scrolling", PlatformAffected.Default)]
public class Issue4756 : TestShell
{
protected override void Init()
{
FlowDirection = FlowDirection.RightToLeft;
FlyoutHeader = new StackLayout();
FlyoutVerticalScrollMode = ScrollMode.Disabled;
for (int i = 0; i < 10; i++)
Items.Add(GenerateItem(i.ToString()));
}

ShellItem GenerateItem(string title)
{
var picker = new Picker
{
ItemsSource = Enum.GetNames(typeof(ScrollMode)),
Title = "FlyoutVerticalScrollMode",
SelectedItem = FlyoutVerticalScrollMode.ToString()
};
picker.SelectedIndexChanged += (_, e) => FlyoutVerticalScrollMode = (ScrollMode)picker.SelectedIndex;

var section = new ShellSection
{
Items =
{
new Forms.ShellContent
{
Content = new ContentPage
{
Content = new StackLayout
{
Children = {
new Button
{
Text = "Add ShellItem",
Command = new Command(() => Items.Add(GenerateItem(Items.Count.ToString())))
},
new Button
{
Text = "Remove ShellItem",
Command = new Command(() => {
if (Items.Count > 1)
Items.RemoveAt(0);
})
},
new Label
{
Text = "FlyoutVerticalScrollMode"
},
picker
}
}
}
}
}
};
var item = new ShellItem
{
Title = title,
Route = title,
Items =
{
section
}
};
item.CurrentItem = section;
return item;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using System;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;

namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 5395, "[macOs] Image Rotation issue", PlatformAffected.macOS)]
public class Issue5395 : ContentPage
{
public Issue5395()
{
var sl = new StackLayout() { Orientation = StackOrientation.Vertical };

sl.Children.Add(new Label() { Text = "Image should rotate clockwise around its center" });
sl.Children.Add(new TestImage(0.5, 0.5, true, false));

sl.Children.Add(new Label() { Text = "Image should rotate clockwise around its top left corner" });
sl.Children.Add(new TestImage(0, 0, true, false));

sl.Children.Add(new Label() { Text = "Image should rotate clockwise around its top right corner" });
sl.Children.Add(new TestImage(1, 0, true, false));

sl.Children.Add(new Label() { Text = "Image should rotate clockwise around its bottom right corner" });
sl.Children.Add(new TestImage(1, 1, true, false));

sl.Children.Add(new Label() { Text = "Image should scale on its center" });
sl.Children.Add(new TestImage(0.5, 0.5, false, true));

Content = sl;
}
class TestImage : Image
{
public TestImage(double anchorx, double anchory, bool rotate, bool scale)
{
VerticalOptions = HorizontalOptions = LayoutOptions.Center;
Aspect = Aspect.AspectFit;
Source = "bank.png";
WidthRequest = 30;
HeightRequest = 30;
BackgroundColor = Color.Red;
AnchorX = anchorx;
AnchorY = anchory;
//TranslationX = -50;
//TranslationY = 25;
if (rotate)
{
this.RotateTo(3600, 10000);
}
if (scale)
{
this.ScaleTo(2, 4000);
}
Margin = 30;
}
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using System.Threading.Tasks;
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, 7283, "[Android] Crash changing the Application MainPage",
PlatformAffected.Android)]
#if UITEST
[NUnit.Framework.Category(UITestCategories.ManualReview)]
#endif
public class Issue7283 : TestContentPage
{
public Issue7283()
{
Title = "Issue 7283";
}

protected override void Init()
{
var layout = new StackLayout
{
Padding = new Thickness(12)
};

var instructions = new Label
{
Text = "Press the Button below. If navigate without any errors, the test has passed."
};

var navigateButton = new Button
{
Text = "Navigate"
};

navigateButton.Clicked += async (sender, e) =>
{
navigateButton.IsEnabled = false;

await Task.Delay(2000);
var navigation = new NavigationPage();
Application.Current.MainPage = navigation;
await Application.Current.MainPage.Navigation.PushAsync(new ContentPage { Title = "Did I crash?" });
};

layout.Children.Add(instructions);
layout.Children.Add(navigateButton);

Content = layout;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
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, 7339, "[iOS] Material frame renderer not being cleared",
PlatformAffected.iOS)]
#if UITEST
[NUnit.Framework.Category(UITestCategories.Shell)]
#endif
public class Issue7339 : TestShell
{
protected override void Init()
{
Visual = VisualMarker.Material;
CreateContentPage("Item1").Content =
new StackLayout()
{
Children =
{
new Frame()
{
Content = new Label()
{
Text = "Navigate between flyout items a few times. If app doesn't crash then test has passed"
}
}
}
};

CreateContentPage("Item2").Content =
new StackLayout() { Children = { new Frame() } };
}

#if UITEST
[Test]
public void MaterialFrameDisposesCorrectly()
{
TapInFlyout("Item1");
TapInFlyout("Item2");
TapInFlyout("Item1");
TapInFlyout("Item2");
}
#endif
}
}
Loading