зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1713030 - [puppeteer] "--foreground" argument for Firefox is only supported on MacOS. r=webdriver-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D128449
This commit is contained in:
Родитель
1541e545c6
Коммит
f84b7f51bd
|
@ -345,16 +345,19 @@ class FirefoxLauncher implements ProductLauncher {
|
|||
}
|
||||
|
||||
defaultArgs(options: BrowserLaunchArgumentOptions = {}): string[] {
|
||||
const firefoxArguments = ['--no-remote', '--foreground'];
|
||||
if (os.platform().startsWith('win')) {
|
||||
firefoxArguments.push('--wait-for-browser');
|
||||
}
|
||||
const {
|
||||
devtools = false,
|
||||
headless = !devtools,
|
||||
args = [],
|
||||
userDataDir = null,
|
||||
} = options;
|
||||
|
||||
const firefoxArguments = ['--no-remote'];
|
||||
|
||||
if (os.platform() === 'darwin') firefoxArguments.push('--foreground');
|
||||
else if (os.platform().startsWith('win')) {
|
||||
firefoxArguments.push('--wait-for-browser');
|
||||
}
|
||||
if (userDataDir) {
|
||||
firefoxArguments.push('--profile');
|
||||
firefoxArguments.push(userDataDir);
|
||||
|
|
|
@ -312,7 +312,11 @@ describe('Launcher specs', function () {
|
|||
} else if (isFirefox) {
|
||||
expect(puppeteer.defaultArgs()).toContain('--headless');
|
||||
expect(puppeteer.defaultArgs()).toContain('--no-remote');
|
||||
expect(puppeteer.defaultArgs()).toContain('--foreground');
|
||||
if (os.platform() === 'darwin') {
|
||||
expect(puppeteer.defaultArgs()).toContain('--foreground');
|
||||
} else {
|
||||
expect(puppeteer.defaultArgs()).not.toContain('--foreground');
|
||||
}
|
||||
expect(puppeteer.defaultArgs({ headless: false })).not.toContain(
|
||||
'--headless'
|
||||
);
|
||||
|
|
Загрузка…
Ссылка в новой задаче