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 Debugger.pause'); | 5 InspectorTest.log('Checks Debugger.pause'); |
6 let contextGroup1 = new InspectorTest.ContextGroup(); | 6 let contextGroup1 = new InspectorTest.ContextGroup(); |
7 let session1 = contextGroup1.connect(); | 7 let session1 = contextGroup1.connect(); |
8 let Protocol1 = session1.Protocol; | 8 let Protocol1 = session1.Protocol; |
9 | 9 |
10 session1.setupScriptMap(); | 10 session1.setupScriptMap(); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 await Protocol1.Debugger.resume(); | 75 await Protocol1.Debugger.resume(); |
76 | 76 |
77 contextGroup1.schedulePauseOnNextStatement('', ''); | 77 contextGroup1.schedulePauseOnNextStatement('', ''); |
78 contextGroup1.cancelPauseOnNextStatement(); | 78 contextGroup1.cancelPauseOnNextStatement(); |
79 await Protocol1.Debugger.pause(); | 79 await Protocol1.Debugger.pause(); |
80 Protocol1.Runtime.evaluate({expression: 'var a = 42;'}); | 80 Protocol1.Runtime.evaluate({expression: 'var a = 42;'}); |
81 await waitPauseAndDumpLocation(session1); | 81 await waitPauseAndDumpLocation(session1); |
82 await Protocol1.Debugger.resume(); | 82 await Protocol1.Debugger.resume(); |
83 }, | 83 }, |
84 | 84 |
| 85 async function testResumeAnotherGroup() { |
| 86 let contextGroup2 = new InspectorTest.ContextGroup(); |
| 87 let session2 = contextGroup2.connect(); |
| 88 session2.setupScriptMap(); |
| 89 let Protocol2 = session2.Protocol; |
| 90 Protocol2.Debugger.enable(); |
| 91 Protocol1.Debugger.pause(); |
| 92 Protocol1.Runtime.evaluate({expression: 'var a = 42;'}); |
| 93 await waitPauseAndDumpLocation(session1); |
| 94 InspectorTest.logMessage(await Protocol2.Debugger.resume()); |
| 95 InspectorTest.logMessage(await Protocol2.Debugger.stepOver()); |
| 96 InspectorTest.logMessage(await Protocol2.Debugger.stepInto()); |
| 97 InspectorTest.logMessage(await Protocol2.Debugger.stepOut()); |
| 98 await Protocol1.Debugger.resume(); |
| 99 await Protocol2.Debugger.disable(); |
| 100 }, |
| 101 |
85 async function testDisableBreaksShouldCancelPause() { | 102 async function testDisableBreaksShouldCancelPause() { |
86 await Protocol1.Debugger.pause(); | 103 await Protocol1.Debugger.pause(); |
87 await Protocol1.Debugger.setBreakpointsActive({active: false}); | 104 await Protocol1.Debugger.setBreakpointsActive({active: false}); |
88 Protocol1.Runtime.evaluate({expression: 'var a = 42;'}) | 105 Protocol1.Runtime.evaluate({expression: 'var a = 42;'}) |
89 .then(() => Protocol1.Debugger.setBreakpointsActive({active: true})) | 106 .then(() => Protocol1.Debugger.setBreakpointsActive({active: true})) |
90 .then(() => Protocol1.Runtime.evaluate({expression: 'debugger'})); | 107 .then(() => Protocol1.Runtime.evaluate({expression: 'debugger'})); |
91 await waitPauseAndDumpLocation(session1); | 108 await waitPauseAndDumpLocation(session1); |
92 await Protocol1.Debugger.resume(); | 109 await Protocol1.Debugger.resume(); |
93 } | 110 } |
94 ]); | 111 ]); |
95 | 112 |
96 async function waitPauseAndDumpLocation(session) { | 113 async function waitPauseAndDumpLocation(session) { |
97 var message = await session.Protocol.Debugger.oncePaused(); | 114 var message = await session.Protocol.Debugger.oncePaused(); |
98 InspectorTest.log('paused at:'); | 115 InspectorTest.log('paused at:'); |
99 await session.logSourceLocation(message.params.callFrames[0].location); | 116 await session.logSourceLocation(message.params.callFrames[0].location); |
100 return message; | 117 return message; |
101 } | 118 } |
OLD | NEW |