return false;
int? line = request?["lineNumber"]?.Value<int>();
- int? column = request?["columnNumber"]?.Value<int>();
+ int column = request?["columnNumber"]?.Value<int>() ?? 0;
- if (line == null || column == null)
+ if (line == null)
return false;
Assembly = sourceFile.AssemblyName;
File = sourceFile.FilePath;
Line = line.Value;
- Column = column.Value;
+ Column = column;
return true;
}
);
}
+ [ConditionalFact(nameof(RunningOnChrome))]
+ public async Task CreateGoodBreakpointWithoutColumnAndHit()
+ {
+ var bp = await SetBreakpoint("dotnet://debugger-test.dll/debugger-test.cs", 10, -1);
+
+ await EvaluateAndCheck(
+ "window.setTimeout(function() { invoke_add(); }, 1);",
+ "dotnet://debugger-test.dll/debugger-test.cs", 10, 8,
+ "Math.IntAdd"
+ );
+ }
+
public static TheoryData<string, string, string, bool> FalseConditions = new TheoryData<string, string, string, bool>
{
{ "invoke_add()", "IntAdd", "0.0", false },
internal virtual async Task<Result> SetBreakpoint(string url_key, int line, int column, bool expect_ok = true, bool use_regex = false, string condition = "")
{
- var bp1_req = !use_regex ?
+ JObject bp1_req;
+ if (column != -1)
+ {
+ bp1_req = !use_regex ?
JObject.FromObject(new { lineNumber = line, columnNumber = column, url = dicFileToUrl[url_key], condition }) :
JObject.FromObject(new { lineNumber = line, columnNumber = column, urlRegex = url_key, condition });
+ }
+ else
+ {
+ bp1_req = !use_regex ?
+ JObject.FromObject(new { lineNumber = line, url = dicFileToUrl[url_key], condition }) :
+ JObject.FromObject(new { lineNumber = line, urlRegex = url_key, condition });
+ }
var bp1_res = await cli.SendCommand("Debugger.setBreakpointByUrl", bp1_req, token);
Assert.True(expect_ok ? bp1_res.IsOk : !bp1_res.IsOk);