mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
test(install): check for Firefox binary, clean up messages (#6316)
This commit is contained in:
parent
142f88c7c4
commit
996e82c7aa
@ -22,7 +22,7 @@ cd $TMPDIR
|
|||||||
PUPPETEER_PRODUCT=firefox npm install --loglevel silent "${tarball}"
|
PUPPETEER_PRODUCT=firefox npm install --loglevel silent "${tarball}"
|
||||||
node --eval="require('puppeteer')"
|
node --eval="require('puppeteer')"
|
||||||
rm "${tarball}"
|
rm "${tarball}"
|
||||||
ls $TMPDIR/node_modules/puppeteer/.local-firefox/
|
ls $TMPDIR/node_modules/puppeteer/.local-firefox/linux-*/firefox/firefox
|
||||||
|
|
||||||
# Again for puppeteer-core
|
# Again for puppeteer-core
|
||||||
cd $ROOTDIR
|
cd $ROOTDIR
|
||||||
|
@ -20,9 +20,6 @@ import ProgressBar from 'progress';
|
|||||||
import puppeteer from './index.js';
|
import puppeteer from './index.js';
|
||||||
import { PUPPETEER_REVISIONS } from './revisions.js';
|
import { PUPPETEER_REVISIONS } from './revisions.js';
|
||||||
|
|
||||||
const firefoxVersions =
|
|
||||||
'https://product-details.mozilla.org/1.0/firefox_versions.json';
|
|
||||||
|
|
||||||
const supportedProducts = {
|
const supportedProducts = {
|
||||||
chrome: 'Chromium',
|
chrome: 'Chromium',
|
||||||
firefox: 'Firefox Nightly',
|
firefox: 'Firefox Nightly',
|
||||||
@ -54,7 +51,7 @@ export async function downloadBrowser() {
|
|||||||
);
|
);
|
||||||
} else if (product === 'firefox') {
|
} else if (product === 'firefox') {
|
||||||
puppeteer._preferredRevision = PUPPETEER_REVISIONS.firefox;
|
puppeteer._preferredRevision = PUPPETEER_REVISIONS.firefox;
|
||||||
return getFirefoxNightlyVersion(browserFetcher.host()).catch((error) => {
|
return getFirefoxNightlyVersion().catch((error) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
});
|
});
|
||||||
@ -141,10 +138,15 @@ export async function downloadBrowser() {
|
|||||||
return `${Math.round(mb * 10) / 10} Mb`;
|
return `${Math.round(mb * 10) / 10} Mb`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFirefoxNightlyVersion(host) {
|
function getFirefoxNightlyVersion() {
|
||||||
|
const firefoxVersions =
|
||||||
|
'https://product-details.mozilla.org/1.0/firefox_versions.json';
|
||||||
|
|
||||||
const promise = new Promise((resolve, reject) => {
|
const promise = new Promise((resolve, reject) => {
|
||||||
let data = '';
|
let data = '';
|
||||||
logPolitely(`Requesting latest Firefox Nightly version from ${host}`);
|
logPolitely(
|
||||||
|
`Requesting latest Firefox Nightly version from ${firefoxVersions}`
|
||||||
|
);
|
||||||
https
|
https
|
||||||
.get(firefoxVersions, (r) => {
|
.get(firefoxVersions, (r) => {
|
||||||
if (r.statusCode >= 400)
|
if (r.statusCode >= 400)
|
||||||
|
Loading…
Reference in New Issue
Block a user