mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
test: setup sandbox on linux (#3530)
Drop all the `--no-sandbox` bits from tests and infrastructure. Instead, configure Travis to enable user namespace clone.
This commit is contained in:
@@ -55,7 +55,6 @@ module.exports.addTests = function({testRunner, expect, defaultBrowserOptions})
|
||||
const extensionOptions = Object.assign({}, defaultBrowserOptions, {
|
||||
headless: false,
|
||||
args: [
|
||||
'--no-sandbox',
|
||||
`--disable-extensions-except=${extensionPath}`,
|
||||
`--load-extension=${extensionPath}`,
|
||||
],
|
||||
|
||||
@@ -116,7 +116,7 @@ module.exports.addTests = function({testRunner, expect, defaultBrowserOptions})
|
||||
it('userDataDir argument', async({server}) => {
|
||||
const userDataDir = await mkdtempAsync(TMP_FOLDER);
|
||||
const options = Object.assign({}, defaultBrowserOptions);
|
||||
options.args = [`--user-data-dir=${userDataDir}`].concat(options.args);
|
||||
options.args = [`--user-data-dir=${userDataDir}`].concat(options.args || []);
|
||||
const browser = await puppeteer.launch(options);
|
||||
expect(fs.readdirSync(userDataDir).length).toBeGreaterThan(0);
|
||||
await browser.close();
|
||||
@@ -209,7 +209,7 @@ module.exports.addTests = function({testRunner, expect, defaultBrowserOptions})
|
||||
});
|
||||
it('should support the pipe argument', async() => {
|
||||
const options = Object.assign({}, defaultBrowserOptions);
|
||||
options.args = ['--remote-debugging-pipe'].concat(options.args);
|
||||
options.args = ['--remote-debugging-pipe'].concat(options.args || []);
|
||||
const browser = await puppeteer.launch(options);
|
||||
expect(browser.wsEndpoint()).toBe('');
|
||||
const page = await browser.newPage();
|
||||
@@ -256,7 +256,7 @@ module.exports.addTests = function({testRunner, expect, defaultBrowserOptions})
|
||||
it('should have custom url when launching browser', async function({server}) {
|
||||
const customUrl = server.PREFIX + '/empty.html';
|
||||
const options = Object.assign({}, defaultBrowserOptions);
|
||||
options.args = [customUrl].concat(options.args);
|
||||
options.args = [customUrl].concat(options.args || []);
|
||||
const browser = await puppeteer.launch(options);
|
||||
const pages = await browser.pages();
|
||||
expect(pages.length).toBe(1);
|
||||
|
||||
@@ -47,7 +47,6 @@ const defaultBrowserOptions = {
|
||||
slowMo,
|
||||
headless,
|
||||
dumpio: (process.env.DUMPIO || 'false').trim().toLowerCase() === 'true',
|
||||
args: ['--no-sandbox']
|
||||
};
|
||||
|
||||
let parallel = 1;
|
||||
|
||||
Reference in New Issue
Block a user