From f0ab3f30229dbf6d4771909077770bc0f4f5686f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Mon, 20 Jul 2020 21:35:09 +0200 Subject: [PATCH 1/2] WASM: Enable System.Reflection.MetadataLoadContext tests `Tests run: 559, Errors: 0, Failures: 0, Skipped: 0. Time: 5.4221639s` --- eng/testing/tests.mobile.targets | 3 +++ .../src/Tests/MetadataLoadContext/PathAssemblyResolver.cs | 6 ++++++ src/libraries/tests.proj | 1 - 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index 284ae301d88880..0f8f4842e21e04 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -132,6 +132,9 @@ + + + diff --git a/src/libraries/System.Reflection.MetadataLoadContext/tests/src/Tests/MetadataLoadContext/PathAssemblyResolver.cs b/src/libraries/System.Reflection.MetadataLoadContext/tests/src/Tests/MetadataLoadContext/PathAssemblyResolver.cs index 7b827af4ff9c6a..501e40c72ecb47 100644 --- a/src/libraries/System.Reflection.MetadataLoadContext/tests/src/Tests/MetadataLoadContext/PathAssemblyResolver.cs +++ b/src/libraries/System.Reflection.MetadataLoadContext/tests/src/Tests/MetadataLoadContext/PathAssemblyResolver.cs @@ -62,6 +62,12 @@ public static void PathAssemblyResolverBasicPathWithRunningAssemblies() // Obtain this test class string thisAssemblyPath = typeof(MetadataLoadContextTests).Assembly.Location; + if (PlatformDetection.IsBrowser) + { + // prepends slash as Assembly.Location only contains the file name on browser (https://github.com/dotnet/runtime/issues/39650) + thisAssemblyPath = "/" + thisAssemblyPath; + } + var resolver = new PathAssemblyResolver(new string[] { coreAssemblyPath, thisAssemblyPath }); using (MetadataLoadContext lc = new MetadataLoadContext(resolver, TestUtils.GetNameOfCoreAssembly())) { diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 0473fc620c0c9e..8e84656c447dff 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -42,7 +42,6 @@ - From d4d9b3b7c8aa3e55c3e40d22ea7943969d7e1df7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Tue, 21 Jul 2020 01:06:09 +0200 Subject: [PATCH 2/2] PR feedback --- eng/testing/tests.mobile.targets | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index 0f8f4842e21e04..70887c7ac77f6f 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -132,9 +132,6 @@ - - - @@ -150,6 +147,11 @@ + + + + +