| 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 <script src="resources/framework.js"></script> | 5 <script src="resources/framework.js"></script> |
| 6 <script> | 6 <script> |
| 7 | 7 |
| 8 function testFunction() | 8 function testFunction() |
| 9 { | 9 { |
| 10 Framework.safeRun(Framework.breakInFramework, Framework.empty) | 10 Framework.safeRun(Framework.breakInFramework, Framework.empty) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 InspectorTest.setQuiet(true); | 22 InspectorTest.setQuiet(true); |
| 23 InspectorTest.startDebuggerTest(step1); | 23 InspectorTest.startDebuggerTest(step1); |
| 24 | 24 |
| 25 var xhrPane; | 25 var xhrPane; |
| 26 | 26 |
| 27 function step1() | 27 function step1() |
| 28 { | 28 { |
| 29 xhrPane = WebInspector.panels.sources.sidebarPanes.xhrBreakpoints; | 29 xhrPane = WebInspector.panels.sources.sidebarPanes.xhrBreakpoints; |
| 30 xhrPane._setBreakpoint("foo", true); | 30 xhrPane._setBreakpoint("foo", true); |
| 31 InspectorTest.runTestFunctionAndWaitUntilPaused(didPause); | 31 InspectorTest.runTestFunctionAndWaitUntilPaused(step2); |
| 32 } | 32 } |
| 33 | 33 |
| 34 var actions = [ | 34 function step2() |
| 35 "Print", // debugger; | |
| 36 "StepInto", "Print", | |
| 37 "StepOver", "Print", | |
| 38 "StepOut", "Print", | |
| 39 "StepInto", "Print", // should not step inside | |
| 40 "Resume", "Print", // should stop on XHR.send() | |
| 41 "StepInto", "Print", // should step inside framework | |
| 42 ]; | |
| 43 | |
| 44 function didPause(callFrames, reason, breakpointIds, asyncStackTrace) | |
| 45 { | 35 { |
| 46 var action = actions.shift(); | 36 var actions = [ |
| 47 if (action === "Print") { | 37 "Print", // debugger; |
| 48 InspectorTest.captureStackTrace(callFrames); | 38 "StepInto", "Print", |
| 49 InspectorTest.addResult(""); | 39 "StepOver", "Print", |
| 50 while (action === "Print") | 40 "StepOut", "Print", |
| 51 action = actions.shift(); | 41 "StepInto", "Print", // should not step inside |
| 52 } | 42 "Resume", "Print", // should stop on XHR.send() |
| 53 | 43 "StepInto", "Print", // should step inside framework |
| 54 if (!action) { | 44 ]; |
| 55 completeTest() | 45 InspectorTest.waitUntilPausedAndPerformSteppingActions(actions, step3); |
| 56 return; | |
| 57 } | |
| 58 | |
| 59 InspectorTest.addResult("Executing " + action + "..."); | |
| 60 switch (action) { | |
| 61 case "StepInto": | |
| 62 WebInspector.panels.sources._stepIntoButton.element.click(); | |
| 63 break; | |
| 64 case "StepOver": | |
| 65 WebInspector.panels.sources._stepOverButton.element.click(); | |
| 66 break; | |
| 67 case "StepOut": | |
| 68 WebInspector.panels.sources._stepOutButton.element.click(); | |
| 69 break; | |
| 70 case "Resume": | |
| 71 InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(Ins
pectorTest, didPause)); | |
| 72 break; | |
| 73 default: | |
| 74 InspectorTest.addResult("FAIL: Unknown action: " + action); | |
| 75 completeTest() | |
| 76 return; | |
| 77 } | |
| 78 InspectorTest.waitUntilResumed(InspectorTest.waitUntilPaused.bind(Inspec
torTest, didPause)); | |
| 79 } | 46 } |
| 80 | 47 |
| 81 function completeTest() | 48 function step3() |
| 82 { | 49 { |
| 83 xhrPane._removeBreakpoint("foo"); | 50 xhrPane._removeBreakpoint("foo"); |
| 84 InspectorTest.completeDebuggerTest(); | 51 InspectorTest.completeDebuggerTest(); |
| 85 } | 52 } |
| 86 } | 53 } |
| 87 | 54 |
| 88 </script> | 55 </script> |
| 89 </head> | 56 </head> |
| 90 | 57 |
| 91 <body onload="runTest()"> | 58 <body onload="runTest()"> |
| 92 <input type='button' onclick='testFunction()' value='Test'/> | 59 <input type='button' onclick='testFunction()' value='Test'/> |
| 93 <p> | 60 <p> |
| 94 Tests stepping from framework call frames. | 61 Tests stepping from framework call frames. |
| 95 </p> | 62 </p> |
| 96 </body> | 63 </body> |
| 97 </html> | 64 </html> |
| OLD | NEW |