Add back --user-data-dir to temp directory

This commit is contained in:
Rob Lourens 2015-10-22 17:22:40 -07:00
Родитель 1c96408132
Коммит 42495afa5a
2 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -90,8 +90,7 @@ suite('Utilities', () => {
assert.deepEqual(Utilities.reversedArr([1, 3, 5, 7]), [7, 5, 3, 1]); assert.deepEqual(Utilities.reversedArr([1, 3, 5, 7]), [7, 5, 3, 1]);
assert.deepEqual( assert.deepEqual(
Utilities.reversedArr([-1, 'hello', null, undefined, [1, 2]]), Utilities.reversedArr([-1, 'hello', null, undefined, [1, 2]]),
[[1, 2], undefined, null, 'hello', -1] [[1, 2], undefined, null, 'hello', -1]);
);
}); });
}); });

Просмотреть файл

@ -10,6 +10,7 @@ import * as Utilities from './utilities';
import {spawn, ChildProcess} from 'child_process'; import {spawn, ChildProcess} from 'child_process';
import * as NodeUrl from 'url'; import * as NodeUrl from 'url';
import * as Path from 'path'; import * as Path from 'path';
import * as Os from 'os';
interface IPendingBreakpoint { interface IPendingBreakpoint {
resolve: (response: SetBreakpointsResponseBody) => void; resolve: (response: SetBreakpointsResponseBody) => void;
@ -84,8 +85,8 @@ export class WebKitDebugAdapter implements IDebugAdapter {
const port = 9222; const port = 9222;
const chromeArgs: string[] = ['--remote-debugging-port=' + port]; const chromeArgs: string[] = ['--remote-debugging-port=' + port];
// Also start with extra stuff disabled, and no user-data-dir so previously open tabs aren't opened. // Also start with extra stuff disabled, and user-data-dir in tmp directory
chromeArgs.push(...['--no-first-run', '--no-default-browser-check']); chromeArgs.push(...['--no-first-run', '--no-default-browser-check', `--user-data-dir=${Os.tmpdir()}/webkitdebugadapter${Date.now()}`]);
if (args.runtimeArguments) { if (args.runtimeArguments) {
chromeArgs.push(...args.runtimeArguments); chromeArgs.push(...args.runtimeArguments);
} }
@ -99,7 +100,7 @@ export class WebKitDebugAdapter implements IDebugAdapter {
///return Promise.reject('The launch config must specify either the "program" or "url" field.'); ///return Promise.reject('The launch config must specify either the "program" or "url" field.');
} }
console.log(`Spawning chrome: '${chromeExe}', ${JSON.stringify(chromeArgs)}`); console.log(`spawn('${chromeExe}', ${JSON.stringify(chromeArgs)})`);
this._chromeProc = spawn(chromeExe, chromeArgs); this._chromeProc = spawn(chromeExe, chromeArgs);
this._chromeProc.on('error', (err) => { this._chromeProc.on('error', (err) => {
console.error('chrome error: ' + err); console.error('chrome error: ' + err);