| OLD | NEW | 
|---|
| 1 // Copyright 2017 the V8 project authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 InspectorTest.log('Checks possible break locations.'); | 5 InspectorTest.log('Checks possible break locations.'); | 
| 6 | 6 | 
| 7 InspectorTest.setupScriptMap(); | 7 InspectorTest.setupScriptMap(); | 
| 8 Protocol.Debugger.onPaused(message => { | 8 Protocol.Debugger.onPaused(message => { | 
| 9   var frames = message.params.callFrames; | 9   var frames = message.params.callFrames; | 
| 10   if (frames.length === 1) { | 10   if (frames.length === 1) { | 
| 11     Protocol.Debugger.stepInto(); | 11     Protocol.Debugger.stepInto(); | 
| 12     return; | 12     return; | 
| 13   } | 13   } | 
| 14   var scriptId = frames[0].location.scriptId; | 14   var scriptId = frames[0].location.scriptId; | 
| 15   InspectorTest.log('break at:'); | 15   InspectorTest.log('break at:'); | 
| 16   InspectorTest.logCallFrameSourceLocation(frames[0]) | 16   InspectorTest.logSourceLocation(frames[0].location) | 
| 17     .then(() => Protocol.Debugger.stepInto()); | 17     .then(() => Protocol.Debugger.stepInto()); | 
| 18 }); | 18 }); | 
| 19 | 19 | 
| 20 InspectorTest.loadScript('test/inspector/debugger/resources/break-locations.js')
    ; | 20 InspectorTest.loadScript('test/inspector/debugger/resources/break-locations.js')
    ; | 
| 21 | 21 | 
| 22 Protocol.Debugger.enable(); | 22 Protocol.Debugger.enable(); | 
| 23 Protocol.Runtime.evaluate({ expression: 'Object.keys(this).filter(name => name.i
    ndexOf(\'test\') === 0)', returnByValue: true }) | 23 Protocol.Runtime.evaluate({ expression: 'Object.keys(this).filter(name => name.i
    ndexOf(\'test\') === 0)', returnByValue: true }) | 
| 24   .then(runTests); | 24   .then(runTests); | 
| 25 | 25 | 
| 26 function runTests(message) { | 26 function runTests(message) { | 
| 27   var tests = message.result.result.value; | 27   var tests = message.result.result.value; | 
| 28   InspectorTest.runTestSuite(tests.map(test => eval(`(function ${test}(next) { | 28   InspectorTest.runTestSuite(tests.map(test => eval(`(function ${test}(next) { | 
| 29     Protocol.Runtime.evaluate({ expression: 'debugger; ${test}()', awaitPromise:
     ${test.indexOf('testPromise') === 0}}) | 29     Protocol.Runtime.evaluate({ expression: 'debugger; ${test}()', awaitPromise:
     ${test.indexOf('testPromise') === 0}}) | 
| 30       .then(next); | 30       .then(next); | 
| 31   })`))); | 31   })`))); | 
| 32 } | 32 } | 
| OLD | NEW | 
|---|