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 print('Checks nested scheduled break in framework code.'); |
| 6 |
| 7 InspectorTest.addScript(` |
| 8 function frameworkCall(callback) { |
| 9 callWithScheduledBreak(doFrameworkWork.bind(null, callback), |
| 10 'top-framework-scheduled-break', |
| 11 JSON.stringify({ data: 'data for top-framework-scheduled-break' })); |
| 12 } |
| 13 |
| 14 function doFrameworkWork(callback) { |
| 15 callWithScheduledBreak(doFrameworkBreak, 'should-not-be-a-reason', ''); |
| 16 callback(); |
| 17 } |
| 18 |
| 19 function doFrameworkBreak() { |
| 20 breakProgram('framework-break', JSON.stringify({ data: 'data for framework-bre
ak' })); |
| 21 } |
| 22 |
| 23 //# sourceURL=framework.js`, 7, 26); |
| 24 |
| 25 InspectorTest.addScript(` |
| 26 function testFunction() { |
| 27 callWithScheduledBreak(frameworkCall.bind(null, callback), |
| 28 'top-scheduled-break', ''); |
| 29 } |
| 30 |
| 31 function callback() { |
| 32 breakProgram('user-break', JSON.stringify({ data: 'data for user-break' })); |
| 33 return 42; |
| 34 } |
| 35 |
| 36 //# sourceURL=user.js`, 25, 26); |
| 37 |
| 38 InspectorTest.setupScriptMap(); |
| 39 Protocol.Debugger.onPaused(message => { |
| 40 InspectorTest.log('break reason: ' + message.params.reason); |
| 41 InspectorTest.log('break aux data: ' + JSON.stringify(message.params.data || {
}, null, ' ')); |
| 42 InspectorTest.logCallFrames(message.params.callFrames); |
| 43 InspectorTest.log(''); |
| 44 Protocol.Debugger.resume(); |
| 45 }); |
| 46 Protocol.Debugger.enable() |
| 47 .then(() => Protocol.Debugger.setBlackboxPatterns({patterns: ['framework\.js']
})) |
| 48 .then(() => Protocol.Runtime.evaluate({ expression: 'testFunction()//# sourceU
RL=expr.js'})) |
| 49 .then(InspectorTest.completeTest); |
OLD | NEW |