blob: f8982e68b5fb234540bcf95d7798877b2f7290ca (
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
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
{
#if UITEST
[Category(UITestCategories.Gestures)]
[Category(UITestCategories.Image)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 57758, "ObjectDisposedException for Xamarin.Forms.Platform.Android.FastRenderers.ImageRenderer", PlatformAffected.Android)]
public class Bugzilla57758 : TestContentPage
{
const string ImageId = "TestImageId";
protected override void Init()
{
var testImage = new Image { Source = "coffee.png", AutomationId = ImageId };
var layout = new StackLayout
{
Padding = new Thickness(0, 20, 0, 0),
Children =
{
testImage
}
};
var tapGesture = new TapGestureRecognizer
{
NumberOfTapsRequired = 1,
Command = new Command(() => layout.Children.Remove(testImage))
};
testImage.GestureRecognizers.Add(tapGesture);
Content = layout;
}
#if UITEST
[Test]
public void RemovingImageWithGestureFromLayoutWithinGestureHandlerDoesNotCrash()
{
RunningApp.WaitForElement(ImageId);
RunningApp.Tap(ImageId);
}
#endif
}
}
|