[Fact]
public async Task StepOutOfAsyncMethod()
{
var insp = new Inspector();
//Collect events
var scripts = SubscribeToScripts(insp);
await Ready();
await insp.Ready(async (cli, token) =>
{
ctx = new DebugTestContext(cli, insp, token, scripts);
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,
"MoveNext");
await StepAndCheck(StepKind.Out, source_file, 15, 4, "TestAsyncStepOut");
});
}
Stepping out, should pause at line 16 in the code below.
public static async Task TestAsyncStepOut()
15: {
16: await TestAsyncStepOut2("foobar");
}
public static async Task<int> TestAsyncStepOut2(string some)
{
var resp = await client.GetAsync("http://localhost:9400/debugger-driver.html");
Console.WriteLine($"resp: {resp}"); /// BP at this line
return 10;
}
Failing test (not added to the repo yet):
Stepping out, should pause at line 16 in the code below.
@thaystg this test is on top of your #42299