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