Index: LayoutTests/inspector/debugger/debug-console-command.html |
diff --git a/LayoutTests/inspector/debugger/debug-console-command.html b/LayoutTests/inspector/debugger/debug-console-command.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..dbd4241650223405b068e2de3e509ac47df84f8c |
--- /dev/null |
+++ b/LayoutTests/inspector/debugger/debug-console-command.html |
@@ -0,0 +1,79 @@ |
+<html> |
+<head> |
+<script src="../../http/tests/inspector/inspector-test.js"></script> |
+<script src="../../http/tests/inspector/debugger-test.js"></script> |
+<script src="../../http/tests/inspector/console-test.js"></script> |
+ |
+<script> |
+function simpleTestFunction() |
+{ |
+ return 0; |
+} |
+</script> |
+ |
+<script> |
+function simpleTestFunction1() { return 0; } function simpleTestFunction2() { return 0; } |
+</script> |
+ |
+<script> |
+var test = function() |
+{ |
+ var currentSourceFrame; |
+ InspectorTest.setQuiet(true); |
+ InspectorTest.runDebuggerTestSuite([ |
+ function testSetSimpleBreakpoint(next) |
+ { |
+ setBreakpointAndRun(next, "debug(simpleTestFunction)", "simpleTestFunction();"); |
+ }, |
+ |
+ function testSetBreakpointOnFirstFunctionInLine(next) |
+ { |
+ setBreakpointAndRun(next, "debug(simpleTestFunction1)", "simpleTestFunction2(); simpleTestFunction1();"); |
+ }, |
+ |
+ function testSetBreakpointOnLastFunctionInLine(next) |
+ { |
+ setBreakpointAndRun(next, "debug(simpleTestFunction2)", "simpleTestFunction1(); simpleTestFunction2();"); |
+ }, |
+ ]); |
+ |
+ function setBreakpointAndRun(next, setBreakpointCmd, runCmd) |
+ { |
+ InspectorTest.addSniffer(WebInspector.BreakpointManager.Breakpoint.prototype, "_setInDebugger", breakpointAdded); |
+ InspectorTest.evaluateInConsole(setBreakpointCmd); |
+ |
+ function breakpointAdded() |
+ { |
+ InspectorTest.addResult("Breakpoint added."); |
+ InspectorTest.evaluateInConsole("setTimeout(function() { " + runCmd + " }, 0)"); |
+ InspectorTest.addResult("Set timer for test function."); |
+ InspectorTest.waitUntilPaused(didPause); |
+ } |
+ |
+ function didPause(callFrames) |
+ { |
+ InspectorTest.addResult("Script execution paused."); |
+ InspectorTest.captureStackTrace(callFrames); |
+ WebInspector.breakpointManager.removeAllBreakpoints(); |
+ InspectorTest.addResult("All breakpoints removed."); |
+ InspectorTest.resumeExecution(didResume); |
+ } |
+ |
+ function didResume() |
+ { |
+ InspectorTest.addResult("Script execution resumed."); |
+ next(); |
+ } |
+ } |
+} |
+ |
+</script> |
+</head> |
+ |
+<body onload="runTest()"> |
+<p> |
+Tests debug(fn) console command. |
+</p> |
+ |
+</body> |
+</html> |