OLD | NEW |
(Empty) | |
| 1 (async function(testRunner) { |
| 2 let {page, session, dp} = await testRunner.startBlank(''); |
| 3 |
| 4 dp.Debugger.enable(); |
| 5 dp.Runtime.evaluate({expression: ` |
| 6 function testFunction() { |
| 7 for (var a of [1]) { |
| 8 ++a; |
| 9 debugger; |
| 10 } |
| 11 } |
| 12 testFunction(); |
| 13 `}); |
| 14 |
| 15 var message = await dp.Debugger.oncePaused(); |
| 16 var scopeChain = message.params.callFrames[0].scopeChain; |
| 17 var localScopeObjectIds = []; |
| 18 for (var scope of scopeChain) { |
| 19 if (scope.type === 'local') |
| 20 localScopeObjectIds.push(scope.object.objectId); |
| 21 } |
| 22 |
| 23 for (var objectId of localScopeObjectIds) |
| 24 testRunner.logObject((await dp.Runtime.getProperties({objectId})).result); |
| 25 |
| 26 await dp.Debugger.resume(); |
| 27 testRunner.completeTest(); |
| 28 }) |
OLD | NEW |