| Index: test/inspector/protocol-test.js
|
| diff --git a/test/inspector/protocol-test.js b/test/inspector/protocol-test.js
|
| index dada81cc0da7a820d96e4d7928be8599c65d8b1e..85279385fe456457475c52ff82e929176b751f8f 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()
|
| @@ -196,6 +213,9 @@ InspectorTest._dispatchMessage = function(messageObject)
|
| var eventHandler = InspectorTest._eventHandler[eventName];
|
| if (eventHandler)
|
| eventHandler(messageObject);
|
| + if (InspectorTest._scriptMap && eventName === "Debugger.scriptParsed") {
|
| + InspectorTest._scriptMap.set(messageObject.params.scriptId, messageObject.params);
|
| + }
|
| }
|
| } catch (e) {
|
| InspectorTest.log("Exception when dispatching message: " + e + "\n" + e.stack + "\n message = " + JSON.stringify(messageObject, null, 2));
|
|
|