Skip to content

Commit 2f5ffda

Browse files
authored
Disable test which requires AssemblyDependencyResolver on mobile (#119801)
On mobile runtimes AssemblyDependencyResolver is not implement and throws. Tests which rely on it will fail. Disabling two new tests which are hitting this condition.
1 parent f2c544a commit 2f5ffda

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/libraries/System.ComponentModel.TypeConverter/tests/TypeDescriptorTests.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,13 +1534,13 @@ private class TestAssemblyLoadContext : AssemblyLoadContext
15341534

15351535
public TestAssemblyLoadContext(string name, bool isCollectible, string mainAssemblyToLoadPath = null) : base(name, isCollectible)
15361536
{
1537-
if (!PlatformDetection.IsBrowser)
1537+
if (!PlatformDetection.IsMobile)
15381538
_resolver = new AssemblyDependencyResolver(mainAssemblyToLoadPath ?? Assembly.GetExecutingAssembly().Location);
15391539
}
15401540

15411541
protected override Assembly Load(AssemblyName name)
15421542
{
1543-
if (PlatformDetection.IsBrowser)
1543+
if (PlatformDetection.IsMobile)
15441544
{
15451545
return base.Load(name);
15461546
}
@@ -1577,10 +1577,9 @@ private static void ExecuteAndUnload(string assemblyfile, Action<Assembly> assem
15771577
alc.Unload();
15781578
}
15791579

1580-
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))]
15811580
// Lack of AssemblyDependencyResolver results in assemblies that are not loaded by path to get
15821581
// loaded in the default ALC, which causes problems for this test.
1583-
[SkipOnPlatform(TestPlatforms.Browser, "AssemblyDependencyResolver not supported in wasm")]
1582+
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported), nameof(PlatformDetection.IsNotMobile))]
15841583
[ActiveIssue("34072", TestRuntimes.Mono)]
15851584
public static void TypeDescriptor_WithDefaultProvider_UnloadsUnloadableTypes()
15861585
{
@@ -1621,10 +1620,9 @@ public static void TypeDescriptor_WithDefaultProvider_UnloadsUnloadableTypes()
16211620
Assert.True(!weakRef.IsAlive);
16221621
}
16231622

1624-
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))]
16251623
// Lack of AssemblyDependencyResolver results in assemblies that are not loaded by path to get
16261624
// loaded in the default ALC, which causes problems for this test.
1627-
[SkipOnPlatform(TestPlatforms.Browser, "AssemblyDependencyResolver not supported in wasm")]
1625+
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported), nameof(PlatformDetection.IsNotMobile))]
16281626
[ActiveIssue("34072", TestRuntimes.Mono)]
16291627
public static void TypeDescriptor_WithCustomProvider_UnloadsUnloadableTypes()
16301628
{

0 commit comments

Comments
 (0)