Index: test/inspector/debugger/pause.js |
diff --git a/test/inspector/debugger/pause.js b/test/inspector/debugger/pause.js |
index 9ffa104ae2f3e0b593bca23c8a690a38d46ddcef..33ebeb830c25f20163f672689f41806ea0a4b523 100644 |
--- a/test/inspector/debugger/pause.js |
+++ b/test/inspector/debugger/pause.js |
@@ -3,95 +3,99 @@ |
// found in the LICENSE file. |
InspectorTest.log('Checks Debugger.pause'); |
+let contextGroup1 = new InspectorTest.ContextGroup(); |
+let session1 = contextGroup1.connect(); |
+let Protocol1 = session1.Protocol; |
-InspectorTest.setupScriptMap(); |
-Protocol.Debugger.enable(); |
+session1.setupScriptMap(); |
+Protocol1.Debugger.enable(); |
InspectorTest.runAsyncTestSuite([ |
async function testPause() { |
- Protocol.Debugger.pause(); |
- Protocol.Runtime.evaluate({expression: 'var a = 42;'}); |
- await waitPauseAndDumpLocation(); |
- await Protocol.Debugger.resume(); |
+ Protocol1.Debugger.pause(); |
+ Protocol1.Runtime.evaluate({expression: 'var a = 42;'}); |
+ await waitPauseAndDumpLocation(session1); |
+ await Protocol1.Debugger.resume(); |
}, |
async function testSkipFrameworks() { |
- Protocol.Debugger.setBlackboxPatterns({patterns: ['framework\.js']}); |
- Protocol.Debugger.pause(); |
- Protocol.Runtime.evaluate({expression: 'var a = 42; //# sourceURL=framework.js'}); |
- Protocol.Runtime.evaluate({expression: 'var a = 239;'}); |
- await waitPauseAndDumpLocation(); |
- await Protocol.Debugger.resume(); |
+ Protocol1.Debugger.setBlackboxPatterns({patterns: ['framework\.js']}); |
+ Protocol1.Debugger.pause(); |
+ Protocol1.Runtime.evaluate({expression: 'var a = 42; //# sourceURL=framework.js'}); |
+ Protocol1.Runtime.evaluate({expression: 'var a = 239;'}); |
+ await waitPauseAndDumpLocation(session1); |
+ await Protocol1.Debugger.resume(); |
}, |
async function testSkipOtherContext1() { |
- let contextGroup = InspectorTest.createContextGroup(); |
- let session = InspectorTest.createSession(contextGroup); |
- session.Protocol.Debugger.enable({}); |
- Protocol.Debugger.pause(); |
- Protocol.Runtime.evaluate({expression: 'var a = 42; //# sourceURL=framework.js'}); |
- session.Protocol.Runtime.evaluate({expression: 'var a = 239;'}); |
- Protocol.Runtime.evaluate({expression: 'var a = 1;'}); |
- await waitPauseAndDumpLocation(); |
- await Protocol.Debugger.resume(); |
- await session.Protocol.Debugger.disable({}); |
+ let contextGroup2 = new InspectorTest.ContextGroup(); |
+ let session2 = contextGroup2.connect(); |
+ let Protocol2 = session2.Protocol; |
+ Protocol2.Debugger.enable({}); |
+ Protocol1.Debugger.pause(); |
+ Protocol1.Runtime.evaluate({expression: 'var a = 42; //# sourceURL=framework.js'}); |
+ Protocol2.Runtime.evaluate({expression: 'var a = 239;'}); |
+ Protocol1.Runtime.evaluate({expression: 'var a = 1;'}); |
+ await waitPauseAndDumpLocation(session1); |
+ await Protocol1.Debugger.resume(); |
+ await Protocol2.Debugger.disable({}); |
}, |
async function testSkipOtherContext2() { |
- let contextGroup = InspectorTest.createContextGroup(); |
- let session = InspectorTest.createSession(contextGroup); |
- InspectorTest.setupScriptMap(session); |
- session.Protocol.Debugger.enable({}); |
- session.Protocol.Debugger.pause({}); |
- Protocol.Runtime.evaluate({expression: 'var a = 42; //# sourceURL=framework.js'}); |
- session.Protocol.Runtime.evaluate({expression: 'var a = 239;'}); |
- Protocol.Runtime.evaluate({expression: 'var a = 1;'}); |
- await waitPauseAndDumpLocation(session); |
+ let contextGroup2 = new InspectorTest.ContextGroup(); |
+ let session2 = contextGroup2.connect(); |
+ let Protocol2 = session2.Protocol; |
+ session2.setupScriptMap(); |
+ Protocol2.Debugger.enable({}); |
+ Protocol2.Debugger.pause({}); |
+ Protocol1.Runtime.evaluate({expression: 'var a = 42; //# sourceURL=framework.js'}); |
+ Protocol2.Runtime.evaluate({expression: 'var a = 239;'}); |
+ Protocol1.Runtime.evaluate({expression: 'var a = 1;'}); |
+ await waitPauseAndDumpLocation(session2); |
// should not resume pause from different context group id. |
- Protocol.Debugger.resume(); |
- session.Protocol.Debugger.stepOver({}); |
- await waitPauseAndDumpLocation(session); |
- await session.Protocol.Debugger.resume({}); |
- await session.Protocol.Debugger.disable({}); |
+ Protocol1.Debugger.resume(); |
+ Protocol2.Debugger.stepOver({}); |
+ await waitPauseAndDumpLocation(session2); |
+ await Protocol2.Debugger.resume({}); |
+ await Protocol2.Debugger.disable({}); |
}, |
async function testWithNativeBreakpoint() { |
- InspectorTest.contextGroup.schedulePauseOnNextStatement('', ''); |
- await Protocol.Debugger.pause(); |
- InspectorTest.contextGroup.cancelPauseOnNextStatement(); |
- Protocol.Runtime.evaluate({expression: 'var a = 42;'}); |
- await waitPauseAndDumpLocation(); |
- await Protocol.Debugger.resume(); |
+ contextGroup1.schedulePauseOnNextStatement('', ''); |
+ await Protocol1.Debugger.pause(); |
+ contextGroup1.cancelPauseOnNextStatement(); |
+ Protocol1.Runtime.evaluate({expression: 'var a = 42;'}); |
+ await waitPauseAndDumpLocation(session1); |
+ await Protocol1.Debugger.resume(); |
- await Protocol.Debugger.pause(); |
- InspectorTest.contextGroup.schedulePauseOnNextStatement('', ''); |
- InspectorTest.contextGroup.cancelPauseOnNextStatement(); |
- Protocol.Runtime.evaluate({expression: 'var a = 42;'}); |
- await waitPauseAndDumpLocation(); |
- await Protocol.Debugger.resume(); |
+ await Protocol1.Debugger.pause(); |
+ contextGroup1.schedulePauseOnNextStatement('', ''); |
+ contextGroup1.cancelPauseOnNextStatement(); |
+ Protocol1.Runtime.evaluate({expression: 'var a = 42;'}); |
+ await waitPauseAndDumpLocation(session1); |
+ await Protocol1.Debugger.resume(); |
- InspectorTest.contextGroup.schedulePauseOnNextStatement('', ''); |
- InspectorTest.contextGroup.cancelPauseOnNextStatement(); |
- await Protocol.Debugger.pause(); |
- Protocol.Runtime.evaluate({expression: 'var a = 42;'}); |
- await waitPauseAndDumpLocation(); |
- await Protocol.Debugger.resume(); |
+ contextGroup1.schedulePauseOnNextStatement('', ''); |
+ contextGroup1.cancelPauseOnNextStatement(); |
+ await Protocol1.Debugger.pause(); |
+ Protocol1.Runtime.evaluate({expression: 'var a = 42;'}); |
+ await waitPauseAndDumpLocation(session1); |
+ await Protocol1.Debugger.resume(); |
}, |
async function testDisableBreaksShouldCancelPause() { |
- await Protocol.Debugger.pause(); |
- await Protocol.Debugger.setBreakpointsActive({active: false}); |
- Protocol.Runtime.evaluate({expression: 'var a = 42;'}) |
- .then(() => Protocol.Debugger.setBreakpointsActive({active: true})) |
- .then(() => Protocol.Runtime.evaluate({expression: 'debugger'})); |
- await waitPauseAndDumpLocation(); |
- await Protocol.Debugger.resume(); |
+ await Protocol1.Debugger.pause(); |
+ await Protocol1.Debugger.setBreakpointsActive({active: false}); |
+ Protocol1.Runtime.evaluate({expression: 'var a = 42;'}) |
+ .then(() => Protocol1.Debugger.setBreakpointsActive({active: true})) |
+ .then(() => Protocol1.Runtime.evaluate({expression: 'debugger'})); |
+ await waitPauseAndDumpLocation(session1); |
+ await Protocol1.Debugger.resume(); |
} |
]); |
async function waitPauseAndDumpLocation(session) { |
- session = session || InspectorTest.session; |
var message = await session.Protocol.Debugger.oncePaused(); |
InspectorTest.log('paused at:'); |
- await InspectorTest.logSourceLocation(message.params.callFrames[0].location, session); |
+ await session.logSourceLocation(message.params.callFrames[0].location); |
return message; |
} |