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

Side by Side Diff: LayoutTests/inspector/debugger/debug-console-command.html

Issue 14294004: Implementing console command 'debug'. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added test. Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/debugger-test.js"></script>
5 <script src="../../http/tests/inspector/console-test.js"></script>
6
7 <script>
8 function simpleTestFunction()
9 {
10 return 0;
11 }
12 </script>
13
14 <script>
15 function simpleTestFunction1() { return 0; } function simpleTestFunction2() { re turn 0; }
16 </script>
17
18 <script>
19 var test = function()
20 {
21 var currentSourceFrame;
22 InspectorTest.setQuiet(true);
23 InspectorTest.runDebuggerTestSuite([
24 function testSetSimpleBreakpoint(next)
25 {
26 setBreakpointAndRun(next, "debug(simpleTestFunction)", "simpleTestFu nction();");
27 },
28
29 function testSetBreakpointOnFirstFunctionInLine(next)
30 {
31 setBreakpointAndRun(next, "debug(simpleTestFunction1)", "simpleTestF unction2(); simpleTestFunction1();");
32 },
33
34 function testSetBreakpointOnLastFunctionInLine(next)
35 {
36 setBreakpointAndRun(next, "debug(simpleTestFunction2)", "simpleTestF unction1(); simpleTestFunction2();");
37 },
38 ]);
39
40 function setBreakpointAndRun(next, setBreakpointCmd, runCmd)
41 {
42 InspectorTest.addSniffer(WebInspector.BreakpointManager.Breakpoint.proto type, "_setInDebugger", breakpointAdded);
43 InspectorTest.evaluateInConsole(setBreakpointCmd);
44
45 function breakpointAdded()
46 {
47 InspectorTest.addResult("Breakpoint added.");
48 InspectorTest.evaluateInConsole("setTimeout(function() { " + runCmd + " }, 0)");
49 InspectorTest.addResult("Set timer for test function.");
50 InspectorTest.waitUntilPaused(didPause);
51 }
52
53 function didPause(callFrames)
54 {
55 InspectorTest.addResult("Script execution paused.");
56 InspectorTest.captureStackTrace(callFrames);
57 WebInspector.breakpointManager.removeAllBreakpoints();
58 InspectorTest.addResult("All breakpoints removed.");
59 InspectorTest.resumeExecution(didResume);
60 }
61
62 function didResume()
63 {
64 InspectorTest.addResult("Script execution resumed.");
65 next();
66 }
67 }
68 }
69
70 </script>
71 </head>
72
73 <body onload="runTest()">
74 <p>
75 Tests debug(fn) console command.
76 </p>
77
78 </body>
79 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698