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

Side by Side Diff: LayoutTests/inspector/sources/debugger/set-breakpoint.html

Issue 1153923005: DevTools: shard inspector/debugger tests for faster execution. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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
6 <script>
7 function oneLineTestFunction() { return 0; }
8 </script>
9
10 <script>
11 function oneLineTestFunction2() { return 0; }</script>
12
13 <script>
14
15 function testFunction()
16 {
17 var x = Math.sqrt(10);
18 return x;
19 }
20
21 var test = function()
22 {
23 var currentSourceFrame;
24 InspectorTest.setQuiet(true);
25 InspectorTest.runDebuggerTestSuite([
26 function testSetBreakpoint(next)
27 {
28 InspectorTest.showScriptSource("set-breakpoint.html", didShowScriptS ource);
29
30 function didShowScriptSource(sourceFrame)
31 {
32 currentSourceFrame = sourceFrame;
33 InspectorTest.addResult("Script source was shown.");
34 setBreakpointAndWaitUntilPaused(currentSourceFrame, 16, didPause );
35 InspectorTest.runTestFunction();
36 }
37
38 function didPause(callFrames)
39 {
40 InspectorTest.addResult("Script execution paused.");
41 InspectorTest.captureStackTrace(callFrames);
42 InspectorTest.dumpBreakpointSidebarPane();
43 InspectorTest.addSniffer(currentSourceFrame, "_removeBreakpointD ecoration", breakpointRemoved);
44 InspectorTest.removeBreakpoint(currentSourceFrame, 16);
45 }
46
47 function breakpointRemoved()
48 {
49 InspectorTest.resumeExecution(didResume);
50 }
51
52 function didResume()
53 {
54 InspectorTest.dumpBreakpointSidebarPane()
55 InspectorTest.addResult("Script execution resumed.");
56 next();
57 }
58 },
59
60 function testSetBreakpointOnTheLastLine(next)
61 {
62 InspectorTest.showScriptSource("set-breakpoint.html", didShowScriptS ource);
63
64 function didShowScriptSource(sourceFrame)
65 {
66 currentSourceFrame = sourceFrame;
67 setBreakpointAndWaitUntilPaused(currentSourceFrame, 6, didPause) ;
68 InspectorTest.evaluateInPage("setTimeout(oneLineTestFunction, 0) ");
69 }
70
71 function didPause(callFrames)
72 {
73 InspectorTest.captureStackTrace(callFrames);
74 InspectorTest.removeBreakpoint(currentSourceFrame, 6);
75 InspectorTest.resumeExecution(next);
76 }
77 },
78
79 function testSetBreakpointOnTheLastLine2(next)
80 {
81 InspectorTest.showScriptSource("set-breakpoint.html", didShowScriptS ource);
82
83 function didShowScriptSource(sourceFrame)
84 {
85 currentSourceFrame = sourceFrame;
86 InspectorTest.setBreakpoint(currentSourceFrame, 10, "", true);
87 InspectorTest.waitUntilPaused(didPause);
88 InspectorTest.evaluateInPage("setTimeout(oneLineTestFunction2, 0 )");
89 }
90
91 function didPause(callFrames)
92 {
93 InspectorTest.captureStackTrace(callFrames);
94 InspectorTest.removeBreakpoint(currentSourceFrame, 10);
95 InspectorTest.resumeExecution(next);
96 }
97 },
98
99 function testSetBreakpointOnTheSameLine(next)
100 {
101 InspectorTest.DebuggerAgent.setBreakpointByUrl(1, "foo.js", undefine d, 2, "", didSetBreakpoint);
102
103 function didSetBreakpoint(error, breakpointId)
104 {
105 InspectorTest.assertTrue(!error);
106 InspectorTest.assertTrue(!!breakpointId);
107 InspectorTest.DebuggerAgent.setBreakpointByUrl(1, "foo.js", unde fined, 2, "", didSetBreakpointAgain);
108 }
109
110 function didSetBreakpointAgain(error, breakpointId)
111 {
112 InspectorTest.assertTrue(!!error);
113 InspectorTest.assertTrue(!breakpointId);
114 next();
115 }
116 }
117 ]);
118
119 function setBreakpointAndWaitUntilPaused(sourceFrame, lineNumber, pausedCall back)
120 {
121 var expectedBreakpointId;
122 InspectorTest.addSniffer(WebInspector.BreakpointManager.TargetBreakpoint .prototype, "_didSetBreakpointInDebugger", didSetBreakpointInDebugger);
123 InspectorTest.setBreakpoint(sourceFrame, lineNumber, "", true);
124
125 function didSetBreakpointInDebugger(callback, breakpointId)
126 {
127 expectedBreakpointId = breakpointId;
128 InspectorTest.waitUntilPaused(didPause);
129 }
130
131 function didPause(callFrames, reason, breakpointIds)
132 {
133 InspectorTest.assertEquals(breakpointIds.length, 1);
134 InspectorTest.assertEquals(breakpointIds[0], expectedBreakpointId);
135 InspectorTest.assertEquals(reason, "other");
136
137 pausedCallback(callFrames);
138 }
139 }
140 }
141
142 </script>
143 </head>
144
145 <body onload="runTest()">
146 <p>
147 Tests setting breakpoints.
148 </p>
149
150 </body>
151 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698