inspector: no URLs when the debugger is connected

By convention, inspector protocol targets do not advertise connection
URLs when the frontend is already connected as multiple inspector
protocol connections are not supported.

PR-URL: https://github.com/nodejs/node/pull/8919
Reviewed-By: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
Eugene Ostroukhov authored and James M Snell committed 2016-10-24 11:31:46 -07:00
1 parent 60042ca70e
commit a54ec7f49c
3 files changed
+82 -65

No files matched your search

+9
View File
@@ -282,6 +282,15 @@ TestSession.prototype.disconnect = function(childDone) {
});
};
TestSession.prototype.testHttpResponse = function(path, check) {
return this.enqueue((callback) =>
checkHttpResponse(this.harness_.port, path, (response) => {
check.call(this, response);
callback();
}));
};
const Harness = function(port, childProcess) {
this.port = port;
this.mainScriptPath = mainScript;
+9
View File
@@ -152,6 +152,14 @@ function testInspectScope(session) {
]);
}
function testNoUrlsWhenConnected(session) {
session.testHttpResponse('/json/list', (response) => {
assert.strictEqual(1, response.length);
assert.ok(!response[0].hasOwnProperty('devtoolsFrontendUrl'));
assert.ok(!response[0].hasOwnProperty('webSocketDebuggerUrl'));
});
}
function testWaitsForFrontendDisconnect(session, harness) {
console.log('[test]', 'Verify node waits for the frontend to disconnect');
session.sendInspectorCommands({ 'method': 'Debugger.resume'})
@@ -165,6 +173,7 @@ function runTests(harness) {
.testHttpResponse('/json/list', checkListResponse)
.testHttpResponse('/json/version', assert.ok)
.runFrontendSession([
testNoUrlsWhenConnected,
testBreakpointOnStart,
testSetBreakpointAndResume,
testInspectScope,