diff --git a/test/webkit/utilities.test.ts b/test/webkit/utilities.test.ts index 1a7e2a8..0aa0723 100644 --- a/test/webkit/utilities.test.ts +++ b/test/webkit/utilities.test.ts @@ -181,7 +181,6 @@ suite('Utilities', () => { suite('webkitUrlToClientUrl()', () => { const TEST_CLIENT_PATH = 'c:/site/scripts/a.js'; - const TEST_WEBKIT_LOCAL_URL = 'file:///' + TEST_CLIENT_PATH; const TEST_WEBKIT_HTTP_URL = 'http://site.com/page/scripts/a.js'; const TEST_CWD = 'c:/site'; @@ -189,10 +188,6 @@ suite('Utilities', () => { return require(MODULE_UNDER_TEST); } - test('file:/// urls are returned canonicalized', () => { - assert.equal(Utilities().webkitUrlToClientUrl('', TEST_WEBKIT_LOCAL_URL), TEST_CLIENT_PATH); - }); - test('an empty string is returned for a missing url', () => { assert.equal(Utilities().webkitUrlToClientUrl('', ''), ''); }); diff --git a/test/webkit/webKitDebugAdapter.test.ts b/test/webkit/webKitDebugAdapter.test.ts index 55feaa1..9d5e082 100644 --- a/test/webkit/webKitDebugAdapter.test.ts +++ b/test/webkit/webKitDebugAdapter.test.ts @@ -222,7 +222,7 @@ suite('WebKitDebugAdapter', () => { // Just assert that the chrome path is some string with 'chrome' in the path, and there are >0 args assert(chromePath.toLowerCase().indexOf('chrome') >= 0); assert(args.indexOf('--remote-debugging-port=9222') >= 0); - assert(args.indexOf('a.js') >= 0); + assert(args.indexOf('c:/a.js') >= 0); assert(args.indexOf('abc') >= 0); assert(args.indexOf('def') >= 0); spawnCalled = true; @@ -230,6 +230,8 @@ suite('WebKitDebugAdapter', () => { return { on: () => { } }; } + // actual path.resolve returns system-dependent slashes + mockery.registerMock('path', { resolve: (a, b) => a + b }); mockery.registerMock('child_process', { spawn }); mockery.registerMock('fs', { statSync: () => true }); mockery.registerMock('os', { @@ -258,7 +260,7 @@ suite('WebKitDebugAdapter', () => { }); function attach(wkda: _WebKitDebugAdapter): Promise { - return wkda.attach({ address: '127.0.0.1', port: 9222, cwd: '.' }); + return wkda.attach({ address: '127.0.0.1', port: 9222, cwd: 'c:/' }); } class DefaultMockWebKitConnection { diff --git a/webkit/webKitDebugAdapter.ts b/webkit/webKitDebugAdapter.ts index 7686c70..4a02f16 100644 --- a/webkit/webKitDebugAdapter.ts +++ b/webkit/webKitDebugAdapter.ts @@ -222,7 +222,7 @@ export class WebKitDebugAdapter implements IDebugAdapter { } public attach(args: IAttachRequestArgs): Promise { - if (args.address !== 'localhost') { + if (args.address !== 'localhost' && args.address !== '127.0.0.1') { return Promise.reject('Remote debugging is not supported'); }