2019-11-18 18:18:28 -08:00
|
|
|
(async() => {
|
2019-12-20 15:10:13 -07:00
|
|
|
process.on('unhandledRejection', error => {
|
|
|
|
|
// Catch various errors as we launch non-browser binary.
|
|
|
|
|
console.log('unhandledRejection', error.message);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const [, , playwrightRoot, usePipe] = process.argv;
|
|
|
|
|
const options = {
|
|
|
|
|
pipe: usePipe === 'use-pipe',
|
|
|
|
|
ignoreDefaultArgs: true,
|
|
|
|
|
dumpio: true,
|
|
|
|
|
timeout: 1,
|
|
|
|
|
executablePath: 'node',
|
|
|
|
|
args: ['-e', 'console.error("message from dumpio")', '--']
|
|
|
|
|
}
|
|
|
|
|
console.error('using pipe: ' + options.pipe);
|
|
|
|
|
if (playwrightRoot.includes('firefox'))
|
|
|
|
|
options.args.push('-juggler', '-profile');
|
|
|
|
|
try {
|
2020-01-07 16:15:07 -08:00
|
|
|
await require(playwrightRoot).launchServer(options);
|
2019-12-20 15:10:13 -07:00
|
|
|
console.error('Browser launch unexpectedly succeeded.');
|
|
|
|
|
} catch (e) {
|
|
|
|
|
}
|
2019-11-18 18:18:28 -08:00
|
|
|
})();
|