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

Unified Diff: LayoutTests/http/tests/inspector/debugger-test.js

Issue 304563002: DevTools: Make frameworks work with "custom" breakpoints (DOM, XHR, Events). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 | « no previous file | LayoutTests/inspector/sources/debugger/async-callstack-and-framework-black-box.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/inspector/debugger-test.js
diff --git a/LayoutTests/http/tests/inspector/debugger-test.js b/LayoutTests/http/tests/inspector/debugger-test.js
index 9d7b5c537babfedb33627b76554fcf905afbb4b6..d380e35e23cf5c9d9068ba64e094359367cf184d 100644
--- a/LayoutTests/http/tests/inspector/debugger-test.js
+++ b/LayoutTests/http/tests/inspector/debugger-test.js
@@ -152,6 +152,46 @@ InspectorTest.resumeExecution = function(callback)
InspectorTest.waitUntilResumed(callback);
};
+InspectorTest.waitUntilPausedAndDumpStackAndResume = function(callback, options)
+{
+ InspectorTest.waitUntilPaused(paused);
+ InspectorTest.addSniffer(WebInspector.CallStackSidebarPane.prototype, "setStatus", setStatus);
+
+ var caption;
+ var callFrames;
+ var asyncStackTrace;
+
+ function setStatus(status)
+ {
+ if (typeof status === "string")
+ caption = status;
+ else
+ caption = status.textContent;
+ if (callFrames)
+ step1();
+ }
+
+ function paused(frames, reason, breakpointIds, async)
+ {
+ callFrames = frames;
+ asyncStackTrace = async;
+ if (typeof caption === "string")
+ step1();
+ }
+
+ function step1()
+ {
+ InspectorTest.captureStackTrace(callFrames, asyncStackTrace, options);
+ InspectorTest.addResult(caption);
+ InspectorTest.runAfterPendingDispatches(step2);
+ }
+
+ function step2()
+ {
+ InspectorTest.resumeExecution(InspectorTest.safeWrap(callback));
+ }
+};
+
InspectorTest.captureStackTrace = function(callFrames, asyncStackTrace, options)
{
InspectorTest.addResult(InspectorTest.captureStackTraceIntoString(callFrames, asyncStackTrace, options));
@@ -164,9 +204,13 @@ InspectorTest.captureStackTraceIntoString = function(callFrames, asyncStackTrace
function printCallFrames(callFrames)
{
+ var printed = 0;
for (var i = 0; i < callFrames.length; i++) {
var frame = callFrames[i];
var script = WebInspector.debuggerModel.scriptForId(frame.location().scriptId);
+ var isFramework = script.isFramework();
+ if (options.dropFrameworkCallFrames && isFramework)
+ continue;
var url;
var lineNumber;
if (script) {
@@ -176,11 +220,12 @@ InspectorTest.captureStackTraceIntoString = function(callFrames, asyncStackTrace
url = "(internal script)";
lineNumber = "(line number)";
}
- var s = " " + i + ") " + frame.functionName + " (" + url + (options.dropLineNumbers ? "" : ":" + lineNumber) + ")";
+ var s = (isFramework ? " * " : " ") + (printed++) + ") " + frame.functionName + " (" + url + (options.dropLineNumbers ? "" : ":" + lineNumber) + ")";
results.push(s);
if (options.printReturnValue && frame.returnValue())
results.push(" <return>: " + frame.returnValue().description);
}
+ return printed;
}
results.push("Call stack:");
@@ -188,7 +233,9 @@ InspectorTest.captureStackTraceIntoString = function(callFrames, asyncStackTrace
while (asyncStackTrace) {
results.push(" [" + (asyncStackTrace.description || "Async Call") + "]");
- printCallFrames(WebInspector.DebuggerModel.CallFrame.fromPayloadArray(WebInspector.targetManager.activeTarget(), asyncStackTrace.callFrames));
+ var printed = printCallFrames(WebInspector.DebuggerModel.CallFrame.fromPayloadArray(WebInspector.targetManager.activeTarget(), asyncStackTrace.callFrames));
+ if (!printed)
+ results.pop();
if (asyncStackTrace.callFrames.peekLast().functionName === "testFunction")
break;
asyncStackTrace = asyncStackTrace.asyncStackTrace;
« no previous file with comments | « no previous file | LayoutTests/inspector/sources/debugger/async-callstack-and-framework-black-box.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698