Skip to content

Commit 022bc67

Browse files
authored
chore(chromium): allow passing --remote-debugging-port for debugging (#1857)
1 parent 55b4bc9 commit 022bc67

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/server/chromium.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export class Chromium implements BrowserType<CRBrowser> {
149149
const userDataDirArg = args.find(arg => arg.startsWith('--user-data-dir'));
150150
if (userDataDirArg)
151151
throw new Error('Pass userDataDir parameter instead of specifying --user-data-dir argument');
152-
if (args.find(arg => arg.startsWith('--remote-debugging-')))
152+
if (args.find(arg => arg.startsWith('--remote-debugging-pipe')))
153153
throw new Error('Playwright manages remote debugging connection itself.');
154154
if (launchType !== 'persistent' && args.find(arg => !arg.startsWith('-')))
155155
throw new Error('Arguments can not specify page to be opened');

test/chromium/launcher.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ describe('launcher', function() {
2626
const error = await browserType.launchServer(options).catch(e => e);
2727
expect(error.message).toContain('Playwright manages remote debugging connection itself');
2828
});
29-
it('should throw with remote-debugging-port argument', async({browserType, defaultBrowserOptions}) => {
29+
it('should not throw with remote-debugging-port argument', async({browserType, defaultBrowserOptions}) => {
3030
const options = Object.assign({}, defaultBrowserOptions);
31-
options.args = ['--remote-debugging-port=9222'].concat(options.args || []);
32-
const error = await browserType.launchServer(options).catch(e => e);
33-
expect(error.message).toContain('Playwright manages remote debugging connection itself');
31+
options.args = ['--remote-debugging-port=0'].concat(options.args || []);
32+
const browser = await browserType.launchServer(options);
33+
await browser.close();
3434
});
3535
it('should open devtools when "devtools: true" option is given', async({browserType, defaultBrowserOptions}) => {
3636
const browser = await browserType.launch(Object.assign({devtools: true}, {...defaultBrowserOptions, headless: false}));

0 commit comments

Comments
 (0)