| Index: LayoutTests/inspector/sources/debugger/frameworks-steppings.html
|
| diff --git a/LayoutTests/inspector/sources/debugger/frameworks-steppings.html b/LayoutTests/inspector/sources/debugger/frameworks-steppings.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..4f9c68e59f47d743480ae8c6dcb807ecb2f3f688
|
| --- /dev/null
|
| +++ b/LayoutTests/inspector/sources/debugger/frameworks-steppings.html
|
| @@ -0,0 +1,115 @@
|
| +<html>
|
| +<head>
|
| +<script src="../../../http/tests/inspector/inspector-test.js"></script>
|
| +<script src="../../../http/tests/inspector/debugger-test.js"></script>
|
| +<script src="resources/framework.js"></script>
|
| +<script>
|
| +
|
| +function testFunction()
|
| +{
|
| + debugger;
|
| + Framework.safeRun(function callback1() {
|
| + Framework.safeRun(Framework.empty, callback2);
|
| + });
|
| +}
|
| +
|
| +function callback2()
|
| +{
|
| + Framework.safeRun(Framework.empty, Framework.empty); // Should be skipped: all callbacks are inside frameworks.
|
| + Framework.safeRun(Framework.empty, Framework.throwFrameworkException, callback3); // Should be enough to step into callback3
|
| +}
|
| +
|
| +function callback3()
|
| +{
|
| + var func = Framework.bind(callback4, null, 1);
|
| + func = Framework.bind(func, null, 2);
|
| + func = Framework.bind(func, null, 3);
|
| + Framework.safeRun(func, Framework.doSomeWork);
|
| +}
|
| +
|
| +function callback4()
|
| +{
|
| + Framework.safeRun(Framework.doSomeWork, function() {
|
| + return 0; // Should NOT step into this callback (otherwise too many StepIns)
|
| + });
|
| + try {
|
| + Framework.throwFrameworkException("message");
|
| + } catch (e) {
|
| + window.ex = e;
|
| + }
|
| +}
|
| +
|
| +function test()
|
| +{
|
| + var frameworkRegexString = "/framework\\.js$";
|
| + WebInspector.experimentsSettings.frameworksDebuggingSupport.enableForTest();
|
| + WebInspector.settings.skipStackFramesSwitch.set(true);
|
| + WebInspector.settings.skipStackFramesPattern.set(frameworkRegexString);
|
| +
|
| + InspectorTest.setQuiet(true);
|
| + InspectorTest.startDebuggerTest(step1);
|
| +
|
| + function step1()
|
| + {
|
| + InspectorTest.runTestFunctionAndWaitUntilPaused(didPause);
|
| + }
|
| +
|
| + var actions = [
|
| + "Print", // debugger;
|
| + "StepInto", "StepInto", "Print", // callback1
|
| + "StepInto", "Print", // callback2
|
| + "StepInto", "Print", // callback2, skipped
|
| + "StepInto", "Print", // callback3
|
| + "StepInto", "StepInto", "StepInto", "StepInto", "Print", // callback4
|
| + "StepInto", "Print", // callback4, skipped
|
| + "StepInto", "Print", // callback4, inside catch
|
| + "StepOut", "Print", // return to callback3
|
| + "StepOver", "Print", // return to callback2
|
| + "StepInto", "Print", // return to callback1
|
| + ];
|
| +
|
| + function didPause(callFrames, reason, breakpointIds, asyncStackTrace)
|
| + {
|
| + var action = actions.shift();
|
| + if (action === "Print") {
|
| + InspectorTest.captureStackTrace(callFrames);
|
| + InspectorTest.addResult("");
|
| + while (action === "Print")
|
| + action = actions.shift();
|
| + }
|
| +
|
| + if (!action) {
|
| + InspectorTest.completeDebuggerTest();
|
| + return;
|
| + }
|
| +
|
| + InspectorTest.addResult("Executing " + action + "...");
|
| + switch (action) {
|
| + case "StepInto":
|
| + WebInspector.panels.sources._stepIntoButton.element.click();
|
| + break;
|
| + case "StepOver":
|
| + WebInspector.panels.sources._stepOverButton.element.click();
|
| + break;
|
| + case "StepOut":
|
| + WebInspector.panels.sources._stepOutButton.element.click();
|
| + break;
|
| + default:
|
| + InspectorTest.addResult("FAIL: Unknown action: " + action);
|
| + InspectorTest.completeDebuggerTest();
|
| + return;
|
| + }
|
| + InspectorTest.waitUntilResumed(InspectorTest.waitUntilPaused.bind(InspectorTest, didPause));
|
| + }
|
| +}
|
| +
|
| +</script>
|
| +</head>
|
| +
|
| +<body onload="runTest()">
|
| +<input type='button' onclick='testFunction()' value='Test'/>
|
| +<p>
|
| +Tests stepping into/over/out with framework black-boxing.
|
| +</p>
|
| +</body>
|
| +</html>
|
|
|