[wasm] WBT: Renable blazor lazy loading test (#85685)
authorAnkit Jain <radical@gmail.com>
Wed, 3 May 2023 01:18:01 +0000 (21:18 -0400)
committerGitHub <noreply@github.com>
Wed, 3 May 2023 01:18:01 +0000 (21:18 -0400)
.. and fix test to work for non-webcil case.

Fixes issue: https://github.com/dotnet/runtime/issues/85354

src/mono/wasm/Wasm.Build.Tests/Blazor/BuildPublishTests.cs

index 769050c..463ddae 100644 (file)
@@ -174,7 +174,6 @@ public class BuildPublishTests : BuildTestBase
     }
 
     [Fact]
-    [ActiveIssue("https://github.com/dotnet/runtime/issues/85354")]
     public void BugRegression_60479_WithRazorClassLib()
     {
         string id = $"blz_razor_lib_top_{Path.GetRandomFileName()}";
@@ -198,12 +197,10 @@ public class BuildPublishTests : BuildTestBase
                 .ExecuteWithCapturedOutput("new razorclasslib")
                 .EnsureSuccessful();
 
-        AddItemsPropertiesToProject(wasmProjectFile, extraItems: UseWebcil ? @"
-            <ProjectReference Include=""..\RazorClassLibrary\RazorClassLibrary.csproj"" />
-            <BlazorWebAssemblyLazyLoad Include=""RazorClassLibrary.webcil"" />
-        " : @"
-            <ProjectReference Include=""..\RazorClassLibrary\RazorClassLibrary.csproj"" />
-            <BlazorWebAssemblyLazyLoad Include=""RazorClassLibrary.dll"" />
+        string razorClassLibraryFileName = UseWebcil ? "RazorClassLibrary.webcil" : "RazorClassLibrary.dll";
+        AddItemsPropertiesToProject(wasmProjectFile, extraItems: @$"
+            <ProjectReference Include=""..\\RazorClassLibrary\\RazorClassLibrary.csproj"" />
+            <BlazorWebAssemblyLazyLoad Include=""{ razorClassLibraryFileName }"" />
         ");
 
         _projectDir = wasmProjectDir;
@@ -226,7 +223,7 @@ public class BuildPublishTests : BuildTestBase
             throw new XunitException($"Could not find resources.lazyAssembly object in {bootJson}");
         }
 
-        Assert.Contains("RazorClassLibrary.webcil", lazyVal.EnumerateObject().Select(jp => jp.Name));
+        Assert.Contains(razorClassLibraryFileName, lazyVal.EnumerateObject().Select(jp => jp.Name));
     }
 
     [ConditionalTheory(typeof(BuildTestBase), nameof(IsUsingWorkloads))]