2016-03-22 23:02:25 +03:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
using Xamarin.Forms.CustomAttributes;
|
|
|
|
|
using System.Threading.Tasks;
|
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, 35733, "iOS WebView crashes when loading an URL with encoded parameters", PlatformAffected.iOS)]
|
|
|
|
|
public class Bugzilla35733 : TestContentPage // or TestMasterDetailPage, etc ...
|
|
|
|
|
{
|
|
|
|
|
protected override void Init ()
|
|
|
|
|
{
|
|
|
|
|
var thisDoesNotWorkButton = new Button {
|
|
|
|
|
Text = "This will crash",
|
|
|
|
|
AutomationId = "btnGo"
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
thisDoesNotWorkButton.Clicked += async (object sender, EventArgs e) => await ShowLocation ("KÅRA");
|
|
|
|
|
|
|
|
|
|
Content = new StackLayout {
|
|
|
|
|
VerticalOptions = LayoutOptions.Center,
|
|
|
|
|
Children = {
|
|
|
|
|
thisDoesNotWorkButton
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async Task ShowLocation(string locationString)
|
|
|
|
|
{
|
2016-11-28 20:09:17 +03:00
|
|
|
|
var stringUri = $"https://raw.githubusercontent.com/xamarin/Xamarin.Forms/master/README.md?l=en&px_location={Uri.EscapeDataString(locationString)}";
|
|
|
|
|
|
2016-03-22 23:02:25 +03:00
|
|
|
|
var uri = new Uri(stringUri);
|
|
|
|
|
var webPage = new ContentPage {
|
|
|
|
|
Title = "WebViewTest",
|
|
|
|
|
Content = new WebView {
|
|
|
|
|
Source = uri
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
await Navigation.PushAsync(webPage);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if UITEST
|
|
|
|
|
[Test]
|
|
|
|
|
public void Bugzilla35733Test ()
|
|
|
|
|
{
|
|
|
|
|
RunningApp.WaitForElement (q => q.Marked ("btnGo"));
|
|
|
|
|
RunningApp.Tap (q => q.Marked ("btnGo"));
|
|
|
|
|
RunningApp.WaitForElement (q => q.Marked ("WebViewTest"));
|
|
|
|
|
RunningApp.Screenshot ("I didn't crash");
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
}
|