Index: test/inspector/protocol-test.js |
diff --git a/test/inspector/protocol-test.js b/test/inspector/protocol-test.js |
index dada81cc0da7a820d96e4d7928be8599c65d8b1e..37e6447f79235410871e23ffebe0d79bb5832674 100644 |
--- a/test/inspector/protocol-test.js |
+++ b/test/inspector/protocol-test.js |
@@ -101,6 +101,17 @@ InspectorTest.logObject = function(object, title) |
InspectorTest.log(lines.join("\n")); |
} |
+InspectorTest.logCallFrames = function(callFrames) |
+{ |
+ for (var frame of callFrames) { |
+ var functionName = frame.functionName || '(anonymous)'; |
+ var url = frame.url ? frame.url : InspectorTest._scriptMap.get(frame.location.scriptId).url; |
+ var lineNumber = frame.location ? frame.location.lineNumber : frame.lineNumber; |
+ var columnNumber = frame.location ? frame.location.columnNumber : frame.columnNumber; |
+ InspectorTest.log(`${functionName} (${url}:${lineNumber}:${columnNumber})`); |
+ } |
+} |
+ |
InspectorTest.completeTest = function() |
{ |
Protocol.Debugger.disable().then(() => quit()); |
@@ -113,7 +124,7 @@ InspectorTest.completeTestAfterPendingTimeouts = function() |
awaitPromise: true }).then(InspectorTest.completeTest); |
} |
-InspectorTest.addScript = (string) => compileAndRunWithOrigin(string, "", 0, 0); |
+InspectorTest.addScript = (string, lineOffset, columnOffset) => compileAndRunWithOrigin(string, "", lineOffset || 0, columnOffset || 0); |
InspectorTest.addScriptWithUrl = (string, url) => compileAndRunWithOrigin(string, url, 0, 0); |
InspectorTest.startDumpingProtocolMessages = function() |
@@ -143,6 +154,12 @@ InspectorTest.checkExpectation = function(fail, name, messageObject) |
InspectorTest.expectedSuccess = InspectorTest.checkExpectation.bind(null, false); |
InspectorTest.expectedError = InspectorTest.checkExpectation.bind(null, true); |
+InspectorTest.setupScriptMap = function() { |
+ if (InspectorTest._scriptMap) |
+ return; |
+ InspectorTest._scriptMap = new Map(); |
+} |
+ |
InspectorTest.runTestSuite = function(testSuite) |
{ |
function nextTest() |
@@ -194,6 +211,8 @@ InspectorTest._dispatchMessage = function(messageObject) |
} else { |
var eventName = messageObject["method"]; |
var eventHandler = InspectorTest._eventHandler[eventName]; |
+ if (InspectorTest._scriptMap && eventName === "Debugger.scriptParsed") |
+ InspectorTest._scriptMap.set(messageObject.params.scriptId, JSON.parse(JSON.stringify(messageObject.params))); |
if (eventHandler) |
eventHandler(messageObject); |
} |