Skip to content
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.

Commit

Permalink
Merge pull request #465 from digeff/add_crdp_parameter_and_logging_name
Browse files Browse the repository at this point in the history
Added the extraCRDPChannelPort parameter and updated logs to be generated on %tmpdir%\vscode-chrome-debug.txt
  • Loading branch information
roblourens authored Jul 26, 2017
2 parents e3823e8 + 626d56c commit 2fc308c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
],
"license": "SEE LICENSE IN LICENSE.txt",
"dependencies": {
"vscode-chrome-debug-core": "3.15.9",
"vscode-chrome-debug-core": "3.16.0",
"vscode-debugadapter": "1.19.0"
},
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion src/chromeDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import {ChromeDebugSession, logger, UrlPathTransformer, BaseSourceMapTransformer} from 'vscode-chrome-debug-core';
import * as path from 'path';
import * as os from 'os';
import {targetFilter} from './utils';

import {ChromeDebugAdapter} from './chromeDebugAdapter';
Expand All @@ -16,7 +17,7 @@ let versionWithDefault = typeof VERSION === 'undefined' ? 'unspecified' : VERSIO

// non-.txt file types can't be uploaded to github
// also note that __dirname here is out/
const logFilePath = path.resolve(__dirname, '../vscode-chrome-debug.txt');
const logFilePath = path.resolve(os.tmpdir(), 'vscode-chrome-debug.txt');

// Start a ChromeDebugSession configured to only match 'page' targets, which are Chrome tabs.
// Cast because DebugSession is declared twice - in this repo's vscode-debugadapter, and that of -core... TODO
Expand Down
6 changes: 3 additions & 3 deletions src/chromeDebugAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class ChromeDebugAdapter extends CoreDebugAdapter {
});

return args.noDebug ? undefined :
this.doAttach(port, launchUrl || args.urlFilter, args.address, args.timeout);
this.doAttach(port, launchUrl || args.urlFilter, args.address, args.timeout, undefined, args.extraCRDPChannelPort);
});
}

Expand All @@ -111,8 +111,8 @@ export class ChromeDebugAdapter extends CoreDebugAdapter {
super.commonArgs(args);
}

protected doAttach(port: number, targetUrl?: string, address?: string, timeout?: number): Promise<void> {
return super.doAttach(port, targetUrl, address, timeout).then(() => {
protected doAttach(port: number, targetUrl?: string, address?: string, timeout?: number, websocketUrl?: string, extraCRDPChannelPort?: number): Promise<void> {
return super.doAttach(port, targetUrl, address, timeout, websocketUrl, extraCRDPChannelPort).then(() => {
// Don't return this promise, a failure shouldn't fail attach
this.globalEvaluate({ expression: 'navigator.userAgent', silent: true })
.then(
Expand Down
2 changes: 1 addition & 1 deletion test/chromeDebugAdapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ suite('ChromeDebugAdapter', () => {
require('fs').statSync = () => true;

mockChromeConnection
.setup(x => x.attach(It.isValue(undefined), It.isAnyNumber(), It.isAnyString(), It.isValue(undefined)))
.setup(x => x.attach(It.isValue(undefined), It.isAnyNumber(), It.isAnyString(), It.isValue(undefined), It.isValue(undefined)))
.returns(() => Promise.resolve())
.verifiable();

Expand Down

0 comments on commit 2fc308c

Please sign in to comment.