Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: test/inspector/protocol-test.js

Issue 2719763002: [inspector] added step-into test to cover most stepInto cases (Closed)
Patch Set: addressed comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/inspector/debugger/step-into-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/inspector/protocol-test.js
diff --git a/test/inspector/protocol-test.js b/test/inspector/protocol-test.js
index d62c2e0c29fc940965c91e1efe14768b1e442a55..3528c32477033abb9a8159c8e8647eeb1d9e8092 100644
--- a/test/inspector/protocol-test.js
+++ b/test/inspector/protocol-test.js
@@ -113,6 +113,32 @@ InspectorTest.logCallFrames = function(callFrames)
}
}
+InspectorTest.logCallFrameSourceLocation = function(callFrame)
+{
+ var scriptId = callFrame.location.scriptId;
+ if (!InspectorTest._scriptMap || !InspectorTest._scriptMap.has(scriptId)) {
+ InspectorTest.log("InspectorTest.setupScriptMap should be called before Protocol.Debugger.enable.");
+ InspectorTest.completeTest();
+ }
+ var script = InspectorTest._scriptMap.get(scriptId);
+ if (!script.scriptSource) {
+ return Protocol.Debugger.getScriptSource({ scriptId })
+ .then(message => script.scriptSource = message.result.scriptSource)
+ .then(dumpSourceWithLocation);
+ }
+ return Promise.resolve().then(dumpSourceWithLocation);
+
+ function dumpSourceWithLocation() {
+ var location = callFrame.location;
+ var lines = script.scriptSource.split('\n');
+ var line = lines[location.lineNumber];
+ line = line.slice(0, location.columnNumber) + '#' + (line.slice(location.columnNumber) || '');
+ lines[location.lineNumber] = line;
+ InspectorTest.log(lines.slice(Math.max(location.lineNumber - 1, 0), location.lineNumber + 2).join('\n'));
+ InspectorTest.log('');
+ }
+}
+
InspectorTest.logAsyncStackTrace = function(asyncStackTrace)
{
while (asyncStackTrace) {
« no previous file with comments | « test/inspector/debugger/step-into-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698