Skip to content

Commit c325398

Browse files
authored
[release/6.0.3xx] [tests] Backport a few introspection fixes. (#15288)
This is a backport of #15230 and #15265.
1 parent 170684c commit c325398

File tree

4 files changed

+40
-2
lines changed

4 files changed

+40
-2
lines changed

tests/introspection/ApiProtocolTest.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,26 @@ protected virtual bool Skip (Type type, string protocolName)
485485
if (!TestRuntime.CheckXcodeVersion (11,0))
486486
return true;
487487
break;
488+
case "VNRecognizedText":
489+
// Conformance added in Xcode 13
490+
if (!TestRuntime.CheckXcodeVersion (13, 0))
491+
return true;
492+
break;
488493
}
489494
break;
495+
case "NSUserActivityRestoring":
496+
return true;
497+
#if __MACCATALYST__
498+
case "UIScrollViewDelegate":
499+
// The headers say PKCanvasViewDelegate implements UIScrollViewDelegate
500+
if (type.Name == "PKCanvasViewDelegate")
501+
return true;
502+
break;
503+
#endif
504+
case "NSExtensionRequestHandling":
505+
if (type.Name == "HMChipServiceRequestHandler") // Apple removed this class
506+
return true;
507+
break;
490508
}
491509
return false;
492510
}
@@ -714,7 +732,9 @@ public void GeneralCase ()
714732

715733
if (t.IsPublic && !ConformTo (klass.Handle, protocol)) {
716734
// note: some internal types, e.g. like UIAppearance subclasses, return false (and there's not much value in changing this)
717-
list.Add ($"Type {t.FullName} (native: {klass.Name}) does not conform {protocolName}");
735+
var msg = $"Type {t.FullName} (native: {klass.Name}) does not conform {protocolName}";
736+
list.Add (msg);
737+
ReportError (msg);
718738
}
719739
}
720740
}

tests/introspection/Mac/MacApiProtocolTest.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,19 @@
1919
namespace Introspection {
2020

2121
[TestFixture]
22-
public class MonoMacFixtures : ApiProtocolTest {
22+
public class MacApiProtocolTest : ApiProtocolTest {
2323

2424
protected override bool Skip (Type type)
2525
{
26+
#if !NET
27+
switch (type.Namespace) {
28+
case "Chip":
29+
// The Chip framework is not stable, it's been added and removed and added and removed a few times already, so just skip verifying the entire framework.
30+
// This is legacy Xamarin only, because we removed the framework for .NET.
31+
return true;
32+
}
33+
#endif
34+
2635
switch (type.Name) {
2736
#if !NET
2837
case "NSDraggingInfo":

tests/introspection/Mac/MacApiSelectorTest.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ protected override bool Skip (Type type)
114114
if (Mac.CheckSystemVersion (10, 15))
115115
return true;
116116
break;
117+
#if !NET
118+
case "Chip":
119+
// The Chip framework is not stable, it's been added and removed and added and removed a few times already, so just skip verifying the entire framework.
120+
// This is legacy Xamarin only, because we removed the framework for .NET.
121+
return true;
122+
#endif
117123
}
118124

119125
return base.Skip (type);

tests/introspection/iOS/iOSApiProtocolTest.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ protected override bool Skip (Type type, string protocolName)
171171
break;
172172
#endif
173173
case "UIAccessibilityElement":
174+
if (protocolName == "UIResponderStandardEditActions" && !TestRuntime.CheckXcodeVersion (11, 0))
175+
return true;
174176
if (protocolName == "UIUserActivityRestoring")
175177
return true;
176178
break;
@@ -199,6 +201,7 @@ protected override bool Skip (Type type, string protocolName)
199201
case "UIStepper":
200202
case "UISwitch":
201203
case "ASAuthorizationAppleIdButton":
204+
case "INUIAddVoiceShortcutButton":
202205
if (protocolName == "UIContextMenuInteractionDelegate")
203206
return !TestRuntime.CheckXcodeVersion (12, 0);
204207
break;

0 commit comments

Comments
 (0)