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:
Andrey Lushnikov
2018-11-12 23:26:16 -08:00
committed by GitHub
parent 10a4c8c123
commit eb7bd9d7d3
10 changed files with 24 additions and 14 deletions

View File

@@ -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');

View File

@@ -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();
});

View File

@@ -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');

View File

@@ -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();