Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Side by Side Diff: test/inspector/debugger/pause.js

Issue 2923243002: [inspector] Return error when paused in different context group (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/inspector/v8-debugger-agent-impl.cc ('k') | test/inspector/debugger/pause-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « src/inspector/v8-debugger-agent-impl.cc ('k') | test/inspector/debugger/pause-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698