blob: ea34195f209dbba6b850b480b918e55aa7166c28 (
plain)
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
|
using System;
using System.Diagnostics;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
#endif
namespace Xamarin.Forms.Controls
{
[Preserve (AllMembers = true)]
public class CustomButton : Button
{
// In the Android project, there's a custom renderer set up for this type
}
[Preserve (AllMembers = true)]
[Issue (IssueTracker.Bugzilla, 35738, "ButtonRenderer UpdateTextColor function crash", PlatformAffected.Android)]
public class Bugzilla35738 : TestContentPage
{
protected override void Init ()
{
var label = new Label () { Text = "If you can see the button, this test has passed" };
var customButton = new CustomButton () { Text = "This is a custom button", TextColor = Color.Fuchsia };
Content = new StackLayout () {
Children = { label, customButton }
};
}
#if UITEST
[Test]
[UiTest (typeof(TestContentPage))]
public void CallingOnElementChangedOnCustomButtonShouldNotCrash ()
{
RunningApp.WaitForElement (q => q.Marked ("This is a custom button"));
}
#endif
}
}
|