-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Bugzilla29247.cs
146 lines (134 loc) · 3.91 KB
/
Bugzilla29247.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
using System;
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.Bugzilla, 29247, "iOS Device.OpenUri breaks with encoded params", PlatformAffected.iOS, issueTestNumber: 1)]
#if UITEST
[Category(Core.UITests.UITestCategories.Bugzilla)]
// this doesn't fail on Uwp but it leaves a browser window open and breaks later tests
[Category(UITestCategories.UwpIgnore)]
#endif
public class Bugzilla29247 : TestContentPage
{
protected override void Init()
{
Content = new StackLayout
{
VerticalOptions = LayoutOptions.Center,
Children = {
new Label {
#pragma warning disable 618
XAlign = TextAlignment.Center,
#pragma warning restore 618
Text = "Welcome to Xamarin Forms!"
},
new Button {
Text = "Without Params (Works)",
AutomationId = "btnOpenUri1",
#pragma warning disable CS0618 // Type or member is obsolete
Command = new Command (() => Device.OpenUri (new Uri ("http://www.bing.com")))
#pragma warning restore CS0618 // Type or member is obsolete
}
}
};
}
#if UITEST
protected override bool Isolate => true;
[Test]
public void Bugzilla29247Test()
{
RunningApp.WaitForElement(q => q.Marked("btnOpenUri1"));
RunningApp.Tap(q => q.Marked("btnOpenUri1"));
}
#endif
}
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 29247, "iOS Device.OpenUri breaks with encoded params 2", PlatformAffected.iOS, issueTestNumber: 2)]
#if UITEST
// This one isn't failing on UWP but it opens a browser window
// and causes the rest to fail
[Category(UITestCategories.UwpIgnore)]
#endif
public class Bugzilla29247_2 : TestContentPage
{
protected override void Init()
{
Content = new StackLayout
{
VerticalOptions = LayoutOptions.Center,
Children = {
new Label {
#pragma warning disable 618
XAlign = TextAlignment.Center,
#pragma warning restore 618
Text = "Welcome to Xamarin Forms!"
},
new Button {
Text = "With encoded Params (Breaks)",
AutomationId = "btnOpenUri2",
#pragma warning disable CS0618 // Type or member is obsolete
Command = new Command (() => Device.OpenUri (new Uri ("http://www.bing.com/search?q=xamarin%20bombs%20on%20this")))
#pragma warning restore CS0618 // Type or member is obsolete
}
}
};
}
#if UITEST
protected override bool Isolate => true;
[Test]
public void Bugzilla29247EncodedParamsTest()
{
RunningApp.WaitForElement(q => q.Marked("btnOpenUri2"));
RunningApp.Tap(q => q.Marked("btnOpenUri2"));
}
#endif
}
#if UITEST
// This one isn't failing on UWP but it opens a browser window
// and causes the rest to fail
[Category(UITestCategories.UwpIgnore)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 29247, "iOS Device.OpenUri breaks with encoded params 3", PlatformAffected.iOS, issueTestNumber: 3)]
public class Bugzilla29247_3 : TestContentPage
{
protected override void Init()
{
Content = new StackLayout
{
VerticalOptions = LayoutOptions.Center,
Children = {
new Label {
#pragma warning disable 618
XAlign = TextAlignment.Center,
#pragma warning restore 618
Text = "Welcome to Xamarin Forms!"
},
new Button {
Text = "With decoded Params (Breaks)",
AutomationId = "btnOpenUri3",
#pragma warning disable CS0618 // Type or member is obsolete
Command = new Command (() => Device.OpenUri (new Uri ("http://www.bing.com/search?q=xamarin bombs on this")))
#pragma warning restore CS0618 // Type or member is obsolete
}
}
};
}
#if UITEST
protected override bool Isolate => true;
[Test]
public void Bugzilla29247DecodeParamsTest()
{
RunningApp.WaitForElement(q => q.Marked("btnOpenUri3"));
RunningApp.Tap(q => q.Marked("btnOpenUri3"));
}
#endif
}
}