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('Checks Debugger.pause'); |
| 6 |
| 7 InspectorTest.setupScriptMap(); |
| 8 Protocol.Debugger.enable(); |
| 9 InspectorTest.runAsyncTestSuite([ |
| 10 async function testPause() { |
| 11 Protocol.Debugger.pause(); |
| 12 Protocol.Runtime.evaluate({expression: 'var a = 42;'}); |
| 13 await waitPauseAndDumpLocation(); |
| 14 await Protocol.Debugger.resume(); |
| 15 }, |
| 16 |
| 17 async function testSkipFrameworks() { |
| 18 Protocol.Debugger.setBlackboxPatterns({patterns: ['framework\.js']}); |
| 19 Protocol.Debugger.pause(); |
| 20 Protocol.Runtime.evaluate({expression: 'var a = 42; //# sourceURL=framework.
js'}); |
| 21 Protocol.Runtime.evaluate({expression: 'var a = 239;'}); |
| 22 await waitPauseAndDumpLocation(); |
| 23 await Protocol.Debugger.resume(); |
| 24 }, |
| 25 |
| 26 async function testSkipOtherContext1() { |
| 27 let contextGroupId = utils.createContextGroup(); |
| 28 Protocol.Debugger.enable({}, contextGroupId); |
| 29 Protocol.Debugger.pause(); |
| 30 Protocol.Runtime.evaluate({expression: 'var a = 42; //# sourceURL=framework.
js'}); |
| 31 Protocol.Runtime.evaluate({expression: 'var a = 239;'}, contextGroupId); |
| 32 Protocol.Runtime.evaluate({expression: 'var a = 1;'}); |
| 33 await waitPauseAndDumpLocation(); |
| 34 await Protocol.Debugger.resume(); |
| 35 }, |
| 36 |
| 37 async function testSkipOtherContext2() { |
| 38 let contextGroupId = utils.createContextGroup(); |
| 39 Protocol.Debugger.enable({}, contextGroupId); |
| 40 Protocol.Debugger.pause({}, contextGroupId); |
| 41 Protocol.Runtime.evaluate({expression: 'var a = 42; //# sourceURL=framework.
js'}); |
| 42 Protocol.Runtime.evaluate({expression: 'var a = 239;'}, contextGroupId); |
| 43 Protocol.Runtime.evaluate({expression: 'var a = 1;'}); |
| 44 await waitPauseAndDumpLocation(); |
| 45 await Protocol.Debugger.resume(); |
| 46 }, |
| 47 |
| 48 async function testWithNativeBreakpoint() { |
| 49 utils.schedulePauseOnNextStatement('', ''); |
| 50 await Protocol.Debugger.pause(); |
| 51 utils.cancelPauseOnNextStatement(); |
| 52 Protocol.Runtime.evaluate({expression: 'var a = 42;'}); |
| 53 await waitPauseAndDumpLocation(); |
| 54 await Protocol.Debugger.resume(); |
| 55 |
| 56 await Protocol.Debugger.pause(); |
| 57 utils.schedulePauseOnNextStatement('', ''); |
| 58 utils.cancelPauseOnNextStatement(); |
| 59 Protocol.Runtime.evaluate({expression: 'var a = 42;'}); |
| 60 await waitPauseAndDumpLocation(); |
| 61 await Protocol.Debugger.resume(); |
| 62 |
| 63 utils.schedulePauseOnNextStatement('', ''); |
| 64 utils.cancelPauseOnNextStatement(); |
| 65 await Protocol.Debugger.pause(); |
| 66 Protocol.Runtime.evaluate({expression: 'var a = 42;'}); |
| 67 await waitPauseAndDumpLocation(); |
| 68 await Protocol.Debugger.resume(); |
| 69 } |
| 70 ]); |
| 71 |
| 72 async function waitPauseAndDumpLocation() { |
| 73 var message = await Protocol.Debugger.oncePaused(); |
| 74 InspectorTest.log('paused at:'); |
| 75 await InspectorTest.logSourceLocation(message.params.callFrames[0].location); |
| 76 return message; |
| 77 } |
OLD | NEW |