Skip to content

Commit

Permalink
[wasm][debugger] Adding test for #42421 (#89395)
Browse files Browse the repository at this point in the history
* Adding test for #42421

* Remove pdb to simulate the same scenario that a customer has.

* Fix tests that have a different behavior without system.private.corelib.pdb
  • Loading branch information
thaystg authored Jul 26, 2023
1 parent 5be8320 commit bc23bf4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
15 changes: 15 additions & 0 deletions src/mono/wasm/debugger/DebuggerTestSuite/AsyncTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,20 @@ await EvaluateAndCheck(
}
);
}

[ConditionalFact(nameof(WasmSingleThreaded), nameof(RunningOnChrome))]
public async Task StepOutOfAsyncMethod()
{
await SetJustMyCode(true);
string source_file = "dotnet://debugger-test.dll/debugger-async-step.cs";

await SetBreakpointInMethod("debugger-test.dll", "DebuggerTests.AsyncStepClass", "TestAsyncStepOut2", 2);
await EvaluateAndCheck(
"window.setTimeout(function() { invoke_static_method_async('[debugger-test] DebuggerTests.AsyncStepClass:TestAsyncStepOut'); }, 1);",
"dotnet://debugger-test.dll/debugger-async-step.cs", 21, 12,
"DebuggerTests.AsyncStepClass.TestAsyncStepOut2");

await StepAndCheck(StepKind.Out, source_file, 16, 8, "DebuggerTests.AsyncStepClass.TestAsyncStepOut");
}
}
}
4 changes: 2 additions & 2 deletions src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -839,9 +839,9 @@ await EvaluateAndCheck(
[Theory]
[InlineData("IDefaultInterface", "DefaultMethod", "Evaluate", "DefaultInterfaceMethod.Evaluate", 1089, 1005, 1003, 1007)]
[InlineData("IExtendIDefaultInterface", "IDefaultInterface.DefaultMethodToOverride", "Evaluate", "DefaultInterfaceMethod.Evaluate", 1090, 1049, 1047, 1051)]
[InlineData("IDefaultInterface", "DefaultMethodAsync", "EvaluateAsync", "System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start<IDefaultInterface.<DefaultMethodAsync>d__3>", 37, 1018, 1016, 1020)]
[InlineData("IDefaultInterface", "DefaultMethodAsync", "EvaluateAsync", "DefaultInterfaceMethod.EvaluateAsync", 1097, 1018, 1016, 1020)]
[InlineData("IDefaultInterface", "DefaultMethodStatic", "EvaluateStatic", "DefaultInterfaceMethod.EvaluateStatic", 1126, 1024, 1022, 1026)]
[InlineData("IDefaultInterface", "DefaultMethodAsyncStatic", "EvaluateAsyncStatic", "System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start<IDefaultInterface.<DefaultMethodAsyncStatic>d__5>", 37, 1033, 1031, 1035)]
[InlineData("IDefaultInterface", "DefaultMethodAsyncStatic", "EvaluateAsyncStatic", "DefaultInterfaceMethod.EvaluateAsyncStatic", 1131, 1033, 1031, 1035)]
public async Task BreakInDefaultInterfaceMethod(
string dimClassName, string dimName, string entryMethod, string prevFrameInDim, int evaluateAsPrevFrameLine, int dimAsPrevFrameLine, int functionLocationLine, int functionEndLine)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
<Target Name="PrepareForWasmBuildApp" DependsOnTargets="Build">
<Error Condition="!Exists('$(MicrosoftNetCoreAppRuntimePackRidDir)native')"
Text="Cannot find %24(MicrosoftNetCoreAppRuntimePackRidDir)=$(MicrosoftNetCoreAppRuntimePackRidDir)native. Make sure to set the runtime configuration with %24(RuntimeConfiguration). Current value: $(RuntimeConfiguration)" />

<!-- Remove pdb from System.Private.CoreLib to have the same scenario that we have in a Blazor/Wasm user app -->
<Delete Files="$(MicrosoftNetCoreAppRuntimePackRidDir)native/System.Private.CoreLib.pdb" />
<PropertyGroup>
<EnableDefaultWasmAssembliesToBundle>false</EnableDefaultWasmAssembliesToBundle>
<WasmAppDir>$(AppDir)</WasmAppDir>
Expand Down

0 comments on commit bc23bf4

Please sign in to comment.