Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/debugger-test.js"></script> | 4 <script src="../../http/tests/inspector/debugger-test.js"></script> |
| 5 | 5 |
| 6 <script> | 6 <script> |
| 7 function oneLineTestFunction() { return 0; } | 7 function oneLineTestFunction() { return 0; } |
| 8 </script> | 8 </script> |
| 9 | 9 |
| 10 <script> | 10 <script> |
| 11 function oneLineTestFunction2() { return 0; }</script> | 11 function oneLineTestFunction2() { return 0; }</script> |
| 12 | 12 |
| 13 <script> | 13 <script> |
| 14 | 14 |
| 15 function testFunction() | 15 function testFunction() |
| 16 { | 16 { |
| 17 var x = Math.sqrt(10); | 17 var x = Math.sqrt(10); |
| 18 return x; | 18 return x; |
| 19 } | 19 } |
| 20 | 20 |
| 21 var test = function() | 21 var test = function() |
| 22 { | 22 { |
| 23 var currentSourceFrame; | 23 var currentSourceFrame; |
| 24 var expectedBreakpointId; | |
| 24 InspectorTest.setQuiet(true); | 25 InspectorTest.setQuiet(true); |
| 25 InspectorTest.runDebuggerTestSuite([ | 26 InspectorTest.runDebuggerTestSuite([ |
| 26 function testSetBreakpoint(next) | 27 function testSetBreakpoint(next) |
| 27 { | 28 { |
| 28 InspectorTest.showScriptSource("set-breakpoint.html", didShowScriptS ource); | 29 InspectorTest.showScriptSource("set-breakpoint.html", didShowScriptS ource); |
| 29 | 30 |
| 30 function didShowScriptSource(sourceFrame) | 31 function didShowScriptSource(sourceFrame) |
| 31 { | 32 { |
| 32 currentSourceFrame = sourceFrame; | 33 currentSourceFrame = sourceFrame; |
| 33 InspectorTest.addResult("Script source was shown."); | 34 InspectorTest.addResult("Script source was shown."); |
| 35 InspectorTest.addSniffer(WebInspector.BreakpointManager.Breakpoi nt.prototype, "_didSetBreakpointInDebugger", didSetBreakpointInDebugger); | |
| 34 InspectorTest.setBreakpoint(currentSourceFrame, 16, "", true); | 36 InspectorTest.setBreakpoint(currentSourceFrame, 16, "", true); |
| 37 } | |
| 38 | |
| 39 function didSetBreakpointInDebugger(breakpointId) | |
| 40 { | |
| 41 expectedBreakpointId = breakpointId; | |
| 35 InspectorTest.runTestFunctionAndWaitUntilPaused(didPause); | 42 InspectorTest.runTestFunctionAndWaitUntilPaused(didPause); |
| 36 } | 43 } |
| 37 | 44 |
| 38 function didPause(callFrames) | 45 function didPause(callFrames, reason, auxData, breakpointIds) |
|
yurys
2013/06/05 08:07:36
didPause signature didn't change in other tests, a
SeRya
2013/06/05 11:34:57
Done.
| |
| 39 { | 46 { |
| 47 InspectorTest.assertEquals(breakpointIds.length, 1); | |
| 48 InspectorTest.assertEquals(breakpointIds.length && breakpointIds [0], expectedBreakpointId); | |
| 49 | |
| 40 InspectorTest.addResult("Script execution paused."); | 50 InspectorTest.addResult("Script execution paused."); |
| 41 InspectorTest.captureStackTrace(callFrames); | 51 InspectorTest.captureStackTrace(callFrames); |
| 42 dumpBreakpointSidebarPane(); | 52 dumpBreakpointSidebarPane(); |
| 43 InspectorTest.addSniffer(currentSourceFrame, "_removeBreakpointD ecoration", breakpointRemoved); | 53 InspectorTest.addSniffer(currentSourceFrame, "_removeBreakpointD ecoration", breakpointRemoved); |
| 44 InspectorTest.removeBreakpoint(currentSourceFrame, 16); | 54 InspectorTest.removeBreakpoint(currentSourceFrame, 16); |
| 45 } | 55 } |
| 46 | 56 |
| 47 function breakpointRemoved() | 57 function breakpointRemoved() |
| 48 { | 58 { |
| 49 InspectorTest.resumeExecution(didResume); | 59 InspectorTest.resumeExecution(didResume); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 129 </script> | 139 </script> |
| 130 </head> | 140 </head> |
| 131 | 141 |
| 132 <body onload="runTest()"> | 142 <body onload="runTest()"> |
| 133 <p> | 143 <p> |
| 134 Tests setting breakpoints. | 144 Tests setting breakpoints. |
| 135 </p> | 145 </p> |
| 136 | 146 |
| 137 </body> | 147 </body> |
| 138 </html> | 148 </html> |
| OLD | NEW |