diff --git a/src/server/chromium.ts b/src/server/chromium.ts index 43c238b2aeb4f..eefd77b8015b0 100644 --- a/src/server/chromium.ts +++ b/src/server/chromium.ts @@ -149,7 +149,7 @@ export class Chromium implements BrowserType { const userDataDirArg = args.find(arg => arg.startsWith('--user-data-dir')); if (userDataDirArg) throw new Error('Pass userDataDir parameter instead of specifying --user-data-dir argument'); - if (args.find(arg => arg.startsWith('--remote-debugging-'))) + if (args.find(arg => arg.startsWith('--remote-debugging-pipe'))) throw new Error('Playwright manages remote debugging connection itself.'); if (launchType !== 'persistent' && args.find(arg => !arg.startsWith('-'))) throw new Error('Arguments can not specify page to be opened'); diff --git a/test/chromium/launcher.spec.js b/test/chromium/launcher.spec.js index 337472cfeaf59..3c41f3df48382 100644 --- a/test/chromium/launcher.spec.js +++ b/test/chromium/launcher.spec.js @@ -26,11 +26,11 @@ describe('launcher', function() { const error = await browserType.launchServer(options).catch(e => e); expect(error.message).toContain('Playwright manages remote debugging connection itself'); }); - it('should throw with remote-debugging-port argument', async({browserType, defaultBrowserOptions}) => { + it('should not throw with remote-debugging-port argument', async({browserType, defaultBrowserOptions}) => { const options = Object.assign({}, defaultBrowserOptions); - options.args = ['--remote-debugging-port=9222'].concat(options.args || []); - const error = await browserType.launchServer(options).catch(e => e); - expect(error.message).toContain('Playwright manages remote debugging connection itself'); + options.args = ['--remote-debugging-port=0'].concat(options.args || []); + const browser = await browserType.launchServer(options); + await browser.close(); }); it('should open devtools when "devtools: true" option is given', async({browserType, defaultBrowserOptions}) => { const browser = await browserType.launch(Object.assign({devtools: true}, {...defaultBrowserOptions, headless: false}));