未验证 提交 495a6207 编写于 作者: T Thays Grazia 提交者: GitHub

Create a method to compare previous frames on call stack for firefox. (#73000)

上级 b61c6f6f
......@@ -822,7 +822,7 @@ public async Task CreateGoodBreakpointAndHitGoToWasmPageWithoutAssetsComeBackAnd
);
}
[ConditionalTheory(nameof(RunningOnChrome))]
[Theory]
[InlineData("IDefaultInterface", "DefaultMethod", "Evaluate", "DefaultInterfaceMethod.Evaluate", 1087, 1003, 1001, 1005)]
[InlineData("IExtendIDefaultInterface", "IDefaultInterface.DefaultMethodToOverride", "Evaluate", "DefaultInterfaceMethod.Evaluate", 1088, 1047, 1045, 1049)]
[InlineData("IDefaultInterface", "DefaultMethodAsync", "EvaluateAsync", "System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start<IDefaultInterface.<DefaultMethodAsync>d__3>", 37, 1016, 1014, 1018)]
......@@ -844,7 +844,7 @@ public async Task CreateGoodBreakpointAndHitGoToWasmPageWithoutAssetsComeBackAnd
// check prev frame in DIM
Assert.Equal(pauseInDim["callFrames"][1]["functionName"].Value<string>(), prevFrameInDim);
Assert.Equal(pauseInDim["callFrames"][1]["location"]["lineNumber"].Value<int>(), evaluateAsPrevFrameLine);
CheckLocationLine(pauseInDim["callFrames"][1]["location"], evaluateAsPrevFrameLine);
string funCalledFromDim = "MethodForCallingFromDIM";
var bpFunCalledFromDim = await SetBreakpointInMethod("debugger-test.dll", "DefaultInterfaceMethod", funCalledFromDim, 1);
......@@ -858,7 +858,7 @@ public async Task CreateGoodBreakpointAndHitGoToWasmPageWithoutAssetsComeBackAnd
string prevFrameFromDim = dimName;
Assert.Equal(pauseInFunCalledFromDim["callFrames"][1]["functionName"].Value<string>(), dimClassName + "." + prevFrameFromDim);
Assert.Equal(pauseInFunCalledFromDim["callFrames"][1]["location"]["lineNumber"].Value<int>(), dimAsPrevFrameLine);
CheckLocationLine(pauseInFunCalledFromDim["callFrames"][1]["location"], dimAsPrevFrameLine);
async Task CheckDefaultMethod(JObject pause_location, string methodName)
......
......@@ -272,6 +272,11 @@ internal virtual void CheckLocation(string script_loc, int line, int column, Dic
Assert.Equal(expected_loc_str, loc_str);
}
internal virtual void CheckLocationLine(JToken location, int line)
{
Assert.Equal(location["lineNumber"].Value<int>(), line);
}
internal void CheckNumber<T>(JToken locals, string name, T value)
{
foreach (var l in locals)
......
......@@ -118,7 +118,6 @@ internal override async Task<Result> SetBreakpoint(string url_key, int line, int
locals_fn: locals_fn);
}
internal override void CheckLocation(string script_loc, int line, int column, Dictionary<string, string> scripts, JToken location)
{
if (location == null) //probably trying to check startLocation endLocation or functionLocation which are not available on Firefox
......@@ -135,6 +134,13 @@ internal override void CheckLocation(string script_loc, int line, int column, Di
Assert.Equal(expected_loc_str, loc_str);
}
internal override void CheckLocationLine(JToken location, int line)
{
if (location == null) //probably trying to check startLocation endLocation or functionLocation which are not available on Firefox
return;
Assert.Equal(location["lineNumber"].Value<int>(), line+1);
}
private JObject ConvertFirefoxToDefaultFormat(JArray frames, JObject wait_res)
{
var callFrames = new JArray();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册