Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / sources / debugger-step / debugger-step-through-promises.html
blob98a73cbeb3e6246a26fea6c65764e913a1d4dae2
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>
7 function testFunction()
9 Promise.resolve(42).then(
10 function p1()
12 debugger;
14 ).then(
15 function p2()
17 var dummy = window.foo || 1;
18 return dummy;
20 ).then(
21 function p3()
23 var dummy = window.foo || 2;
24 return dummy;
26 ).catch(function(e) {
27 console.error("FAIL: Unexpected exception: " + e);
28 });
31 function test()
33 InspectorTest.startDebuggerTest(step1, true);
35 function step1()
37 InspectorTest.runTestFunctionAndWaitUntilPaused(step2);
40 function step2()
42 var actions = [
43 "Print", // debugger; at p1
44 "StepInto", "Print",
45 "StepInto", "Print", // entered p2
46 "StepOver", "Print",
47 "StepOver", "Print",
48 "StepOver", "Print", // entered p3
49 "StepOver", "Print",
51 InspectorTest.waitUntilPausedAndPerformSteppingActions(actions, step3);
54 function step3()
56 InspectorTest.completeDebuggerTest();
60 </script>
61 </head>
63 <body onload="runTest()">
64 <input type='button' onclick='testFunction()' value='Test'/>
65 <p>
66 Tests that debugger will step through Promise handlers while not stepping into V8 internal scripts.
67 </p>
68 </body>
69 </html>