OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 InspectorTest.log('Stepping with natives and frameworks.'); |
| 6 |
| 7 InspectorTest.addScript(` |
| 8 function callAll() { |
| 9 for (var f of arguments) |
| 10 f(); |
| 11 } |
| 12 //# sourceURL=framework.js`); |
| 13 |
| 14 InspectorTest.setupScriptMap(); |
| 15 InspectorTest.dumpProtocolCommand('Debugger.pause'); |
| 16 InspectorTest.dumpProtocolCommand('Debugger.stepInto'); |
| 17 InspectorTest.dumpProtocolCommand('Debugger.stepOver'); |
| 18 InspectorTest.dumpProtocolCommand('Debugger.stepOut'); |
| 19 InspectorTest.dumpProtocolCommand('Debugger.resume'); |
| 20 |
| 21 Protocol.Debugger.enable(); |
| 22 Protocol.Debugger.setBlackboxPatterns({patterns: ['framework\.js']}); |
| 23 InspectorTest.runAsyncTestSuite([ |
| 24 async function testNativeCodeStepOut() { |
| 25 Protocol.Debugger.pause(); |
| 26 Protocol.Runtime.evaluate({expression: '[1,2].map(v => v);'}); |
| 27 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 28 Protocol.Debugger.stepInto(); |
| 29 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 30 Protocol.Debugger.stepOut(); |
| 31 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 32 Protocol.Debugger.stepOut(); |
| 33 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 34 await Protocol.Debugger.resume(); |
| 35 }, |
| 36 |
| 37 async function testNativeCodeStepOver() { |
| 38 Protocol.Debugger.pause(); |
| 39 Protocol.Runtime.evaluate({expression: '[1,2].map(v => v);'}); |
| 40 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 41 Protocol.Debugger.stepInto(); |
| 42 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 43 Protocol.Debugger.stepOver(); |
| 44 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 45 Protocol.Debugger.stepOver(); |
| 46 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 47 Protocol.Debugger.stepOver(); |
| 48 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 49 Protocol.Debugger.stepOver(); |
| 50 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 51 await Protocol.Debugger.resume(); |
| 52 }, |
| 53 |
| 54 async function testNativeCodeStepInto() { |
| 55 Protocol.Debugger.pause(); |
| 56 Protocol.Runtime.evaluate({expression: '[1,2].map(v => v);'}); |
| 57 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 58 Protocol.Debugger.stepInto(); |
| 59 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 60 Protocol.Debugger.stepInto(); |
| 61 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 62 Protocol.Debugger.stepInto(); |
| 63 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 64 Protocol.Debugger.stepInto(); |
| 65 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 66 Protocol.Debugger.stepInto(); |
| 67 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 68 await Protocol.Debugger.resume(); |
| 69 }, |
| 70 |
| 71 async function testFrameworkCodeStepInto() { |
| 72 Protocol.Debugger.pause(); |
| 73 Protocol.Runtime.evaluate({expression: 'callAll(() => 1, () => 2);'}); |
| 74 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 75 Protocol.Debugger.stepInto(); |
| 76 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 77 Protocol.Debugger.stepInto(); |
| 78 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 79 Protocol.Debugger.stepInto(); |
| 80 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 81 Protocol.Debugger.stepInto(); |
| 82 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 83 Protocol.Debugger.stepInto(); |
| 84 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 85 await Protocol.Debugger.resume(); |
| 86 }, |
| 87 |
| 88 async function testFrameworkCodeStepOver() { |
| 89 Protocol.Debugger.pause(); |
| 90 Protocol.Runtime.evaluate({expression: 'callAll(() => 1, () => 2);'}); |
| 91 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 92 Protocol.Debugger.stepInto(); |
| 93 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 94 Protocol.Debugger.stepOver(); |
| 95 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 96 Protocol.Debugger.stepOver(); |
| 97 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 98 Protocol.Debugger.stepOver(); |
| 99 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 100 Protocol.Debugger.stepOver(); |
| 101 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 102 await Protocol.Debugger.resume(); |
| 103 }, |
| 104 |
| 105 async function testFrameworkCodeStepOut() { |
| 106 Protocol.Debugger.pause(); |
| 107 Protocol.Runtime.evaluate({expression: 'callAll(() => 1, () => 2);'}); |
| 108 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 109 Protocol.Debugger.stepInto(); |
| 110 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 111 Protocol.Debugger.stepOut(); |
| 112 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 113 Protocol.Debugger.stepOut(); |
| 114 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 115 await Protocol.Debugger.resume(); |
| 116 }, |
| 117 |
| 118 async function testFrameworkNextCallDeeperStepOut() { |
| 119 Protocol.Debugger.pause(); |
| 120 Protocol.Runtime.evaluate({ |
| 121 expression: 'callAll(() => 1, callAll.bind(null, () => 2));'}); |
| 122 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 123 Protocol.Debugger.stepInto(); |
| 124 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 125 Protocol.Debugger.stepOut(); |
| 126 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 127 Protocol.Debugger.stepOut(); |
| 128 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 129 await Protocol.Debugger.resume(); |
| 130 }, |
| 131 |
| 132 async function testFrameworkNextCallDeeperStepInto() { |
| 133 Protocol.Debugger.pause(); |
| 134 Protocol.Runtime.evaluate({ |
| 135 expression: 'callAll(() => 1, callAll.bind(null, () => 2));'}); |
| 136 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 137 Protocol.Debugger.stepInto(); |
| 138 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 139 Protocol.Debugger.stepOver(); |
| 140 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 141 Protocol.Debugger.stepOver(); |
| 142 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 143 Protocol.Debugger.stepOver(); |
| 144 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 145 Protocol.Debugger.stepOver(); |
| 146 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 147 await Protocol.Debugger.resume(); |
| 148 }, |
| 149 |
| 150 async function testFrameworkNextCallDeeperStepOver() { |
| 151 Protocol.Debugger.pause(); |
| 152 Protocol.Runtime.evaluate({ |
| 153 expression: 'callAll(() => 1, callAll.bind(null, () => 2));'}); |
| 154 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 155 Protocol.Debugger.stepInto(); |
| 156 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 157 Protocol.Debugger.stepOver(); |
| 158 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 159 Protocol.Debugger.stepOver(); |
| 160 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 161 Protocol.Debugger.stepOver(); |
| 162 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 163 Protocol.Debugger.stepOver(); |
| 164 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 165 await Protocol.Debugger.resume(); |
| 166 }, |
| 167 |
| 168 async function testFrameworkCurrentCallDeeperStepOut() { |
| 169 Protocol.Debugger.pause(); |
| 170 Protocol.Runtime.evaluate({ |
| 171 expression: 'callAll(callAll.bind(null, () => 1), () => 2);'}); |
| 172 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 173 Protocol.Debugger.stepInto(); |
| 174 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 175 Protocol.Debugger.stepOut(); |
| 176 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 177 Protocol.Debugger.stepOut(); |
| 178 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 179 await Protocol.Debugger.resume(); |
| 180 }, |
| 181 |
| 182 async function testFrameworkCurrentCallDeeperStepOver() { |
| 183 Protocol.Debugger.pause(); |
| 184 Protocol.Runtime.evaluate({ |
| 185 expression: 'callAll(callAll.bind(null, () => 1), () => 2);'}); |
| 186 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 187 Protocol.Debugger.stepInto(); |
| 188 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 189 Protocol.Debugger.stepOver(); |
| 190 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 191 Protocol.Debugger.stepOver(); |
| 192 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 193 Protocol.Debugger.stepOver(); |
| 194 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 195 Protocol.Debugger.stepOver(); |
| 196 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 197 await Protocol.Debugger.resume(); |
| 198 }, |
| 199 |
| 200 async function testFrameworkCurrentCallDeeperStepInto() { |
| 201 Protocol.Debugger.pause(); |
| 202 Protocol.Runtime.evaluate({ |
| 203 expression: 'callAll(callAll.bind(null, () => 1), () => 2);'}); |
| 204 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 205 Protocol.Debugger.stepInto(); |
| 206 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 207 Protocol.Debugger.stepInto(); |
| 208 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 209 Protocol.Debugger.stepInto(); |
| 210 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 211 Protocol.Debugger.stepInto(); |
| 212 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 213 Protocol.Debugger.stepInto(); |
| 214 await logPauseLocation(await Protocol.Debugger.oncePaused()); |
| 215 await Protocol.Debugger.resume(); |
| 216 } |
| 217 ]); |
| 218 |
| 219 function logPauseLocation(message) { |
| 220 return InspectorTest.logSourceLocation(message.params.callFrames[0].location); |
| 221 } |
OLD | NEW |