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:
@@ -15,10 +15,6 @@ const {it, xit, fit} = testRunner;
|
||||
const {afterAll, beforeAll, afterEach, beforeEach} = testRunner;
|
||||
const {expect} = new Matchers();
|
||||
|
||||
const defaultBrowserOptions = {
|
||||
args: ['--no-sandbox']
|
||||
};
|
||||
|
||||
beforeAll(async state => {
|
||||
const assetsPath = path.join(__dirname, '..', '..', 'test', 'assets');
|
||||
const port = 8998;
|
||||
@@ -27,7 +23,7 @@ beforeAll(async state => {
|
||||
PREFIX: `http://localhost:${port}`,
|
||||
EMPTY_PAGE: `http://localhost:${port}/empty.html`,
|
||||
};
|
||||
state.browser = await puppeteer.launch(defaultBrowserOptions);
|
||||
state.browser = await puppeteer.launch();
|
||||
});
|
||||
|
||||
afterAll(async state => {
|
||||
@@ -54,7 +50,7 @@ afterEach(async state => {
|
||||
|
||||
describe('Puppeteer-Web', () => {
|
||||
it('should work over web socket', async({page, serverConfig}) => {
|
||||
const browser2 = await puppeteer.launch(defaultBrowserOptions);
|
||||
const browser2 = await puppeteer.launch();
|
||||
// Use in-page puppeteer to create a new page and navigate it to the EMPTY_PAGE
|
||||
await page.evaluate(async(browserWSEndpoint, serverConfig) => {
|
||||
const puppeteer = require('puppeteer');
|
||||
|
||||
@@ -34,7 +34,7 @@ let browser;
|
||||
let page;
|
||||
|
||||
beforeAll(async function() {
|
||||
browser = await puppeteer.launch({args: ['--no-sandbox']});
|
||||
browser = await puppeteer.launch();
|
||||
page = await browser.newPage();
|
||||
});
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ async function run() {
|
||||
messages.push(...await preprocessor.runCommands(mdSources, VERSION));
|
||||
messages.push(...await preprocessor.ensureReleasedAPILinks([readme], VERSION));
|
||||
|
||||
const browser = await puppeteer.launch({args: ['--no-sandbox']});
|
||||
const browser = await puppeteer.launch();
|
||||
const page = await browser.newPage();
|
||||
const checkPublicAPI = require('./check_public_api');
|
||||
const jsSources = await Source.readdir(path.join(PROJECT_DIR, 'lib'), '.js');
|
||||
|
||||
@@ -4,7 +4,6 @@ const puppeteer = require('../..');
|
||||
module.exports = puppeteer.launch({
|
||||
pipe: false,
|
||||
executablePath: process.env.CHROME,
|
||||
args: ['--no-sandbox', '--disable-dev-shm-usage']
|
||||
}).then(async browser => {
|
||||
const origin = browser.wsEndpoint().match(/ws:\/\/([0-9A-Za-z:\.]*)\//)[1];
|
||||
const page = await browser.newPage();
|
||||
|
||||
Reference in New Issue
Block a user