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>
8 var dummy
= function FAIL_should_not_pause_here() { return 0; };
10 function testFunction()
12 debugger; // <- will turn on async call stacks here.
15 setTimeout(callback7
, 20); // <- StepIntoAsync
24 var p
= Promise
.reject(new Error("my error"));
25 p
.catch(function() {});
27 return p
; // <- StepIntoAsync
31 .catch(Framework
.throwFrameworkException
)
39 Object
.observe(obj
, callback9
);
41 obj
.foo
= 1; // <- StepIntoAsync
48 var iframe
= document
.getElementById("iframe");
49 var win
= iframe
.contentWindow
;
50 window
.addEventListener("message", callback10
, false);
52 win
.postMessage("skip debugger", "*"); // <- StepIntoAsync
54 Promise
.resolve().then(dummy
);
60 window
.removeEventListener("message", callback10
, false);
62 Promise
.resolve({foo
: 44}) // <- StepIntoAsync
64 function inner1() // <- StepIntoAsync when in inner1 should lead debugger to the
65 { // next promise handler in the chain, i.e. the one, which will
66 } // receive the result returned by inner1, that is inner2.
68 .then(Framework
.empty
)
87 var maxAsyncCallStackDepth
= 4;
88 var frameworkRegexString
= "/framework\\.js$";
89 WebInspector
.settingForTest("skipStackFramesPattern").set(frameworkRegexString
);
91 InspectorTest
.startDebuggerTest(step1
, true);
95 InspectorTest
.runTestFunctionAndWaitUntilPaused(step2
);
100 InspectorTest
.DebuggerAgent
.setAsyncCallStackDepth(maxAsyncCallStackDepth
, step3
);
106 "StepOver", "StepOver", "Print", // on setTimeout(callback1)
107 "StepIntoAsync", "Print", // at callback7
108 "Resume", // now paused at debugger in inner()
109 "StepOver", "StepOver", "StepIntoAsync", "Print", // at callback8
110 "Resume", "StepOver", "StepIntoAsync", "Print", // at callback9
111 "Resume", "StepOver", "StepIntoAsync", "Print", // at onmessage handler in iframe
112 "Resume", // now paused at debugger in callback10
113 "StepInto", "StepIntoAsync", "Print", // in inner1
114 "StepIntoAsync", "Print", // in inner2
115 // Test that StepIntoAsync is StepInto when there are no Async operations.
116 "StepIntoAsync", "StepIntoAsync", "Print", // in callback11
118 InspectorTest
.waitUntilPausedAndPerformSteppingActions(actions
, step4
);
123 InspectorTest
.completeDebuggerTest();
130 <body onload=
"runTest()">
132 Tests debugger StepIntoAsync action (part
2).
134 <div><iframe src=
"../debugger/resources/post-message-listener.html"
135 id=
"iframe" width=
"800" height=
"100" style=
"border: 1px solid black;">