feat: download chrome-headless-shell by default and use it for the old headless mode (#11093)

This commit is contained in:
Alex Rudenko
2023-12-07 11:00:20 +01:00
committed by GitHub
parent e956daa7fa
commit 75ba27bca2
13 changed files with 127 additions and 42 deletions

View File

@@ -40,8 +40,9 @@ describe('`puppeteer` with configuration', () => {
it('evaluates', async function () {
const files = await readdir(join(this.sandbox, '.cache', 'puppeteer'));
assert.equal(files.length, 1);
assert.equal(files[0], 'chrome');
assert.equal(files.length, 2);
assert(files.includes('chrome'));
assert(files.includes('chrome-headless-shell'));
const script = await readAsset('puppeteer', 'basic.js');
await this.runScript(script, 'mjs');
@@ -71,8 +72,9 @@ describe('`puppeteer` with configuration', () => {
it('evaluates', async function () {
const files = await readdir(join(this.sandbox, '.cache', 'puppeteer'));
assert.equal(files.length, 1);
assert.equal(files[0], 'chrome');
assert.equal(files.length, 2);
assert(files.includes('chrome'));
assert(files.includes('chrome-headless-shell'));
const script = await readAsset('puppeteer', 'basic.js');
await this.runScript(script, 'mjs');

View File

@@ -35,8 +35,10 @@ describe('`puppeteer`', () => {
it('evaluates CommonJS', async function () {
const files = await readdir(join(this.sandbox, '.cache', 'puppeteer'));
assert.equal(files.length, 1);
assert.equal(files[0], 'chrome');
assert.equal(files.length, 2);
assert(files.includes('chrome'));
assert(files.includes('chrome-headless-shell'));
const script = await readAsset('puppeteer-core', 'requires.cjs');
await this.runScript(script, 'cjs');
});
@@ -62,8 +64,9 @@ describe('`puppeteer`', () => {
it('evaluates', async function () {
const files = await readdir(join(this.sandbox, '.cache', 'puppeteer'));
assert.equal(files.length, 1);
assert.equal(files[0], 'chrome');
assert.equal(files.length, 2);
assert(files.includes('chrome'));
assert(files.includes('chrome-headless-shell'));
const script = await readAsset('puppeteer', 'basic.js');
await this.runScript(script, 'mjs');