Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / sources / debugger-frameworks / frameworks-skip-step-in.html
blobbdb910b3c4c56479214d3ca8e3de8f50aff76178
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="../debugger/resources/framework.js"></script>
6 <script>
8 function testFunction()
10 for (var i = 1, func; func = eval("typeof test" + i + " === 'function' && test" + i); ++i)
11 func();
14 function callback()
16 return 0;
19 function test1()
21 debugger;
22 Framework.empty();
25 function test2()
27 debugger;
28 Framework.doSomeWork();
31 function test3()
33 debugger;
34 Framework.safeRun(Framework.empty, callback); // Should step into callback
37 function test4()
39 debugger;
40 Framework.safeRun(Framework.doSomeWork, callback); // Should NOT step into callback (otherwise too many StepIns)
43 function test5()
45 debugger;
46 Framework.safeRun(Framework.empty, Framework.throwFrameworkException, callback); // Should be enough to step into callback
49 function test6()
51 debugger;
52 Framework.safeRun(Framework.doSomeWorkDoNotChangeTopCallFrame, callback);
55 function test()
57 var frameworkRegexString = "/framework\\.js$";
58 var totalDebuggerStatements = 6;
60 WebInspector.settingForTest("skipStackFramesPattern").set(frameworkRegexString);
62 InspectorTest.setQuiet(true);
63 InspectorTest.startDebuggerTest(step1);
65 function step1()
67 InspectorTest.runTestFunctionAndWaitUntilPaused(didPause);
70 var step = 0;
71 var stepInCount = 0;
72 function didPause(callFrames, reason, breakpointIds, asyncStackTrace)
74 if (stepInCount < 2) {
75 ++stepInCount;
76 WebInspector.panels.sources._stepIntoButton.element.click();
77 InspectorTest.waitUntilResumed(InspectorTest.waitUntilPaused.bind(InspectorTest, didPause));
78 return;
81 stepInCount = 0;
82 InspectorTest.captureStackTrace(callFrames);
83 InspectorTest.addResult("");
84 if (++step < totalDebuggerStatements)
85 InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(InspectorTest, didPause));
86 else
87 InspectorTest.completeDebuggerTest();
91 </script>
92 </head>
94 <body onload="runTest()">
95 <input type='button' onclick='testFunction()' value='Test'/>
96 <p>
97 Tests the skip stack frames feature when stepping.
98 </p>
99 </body>
100 </html>