MCPcopy Index your code
hub / github.com/react/react / initChrome

Function initChrome

scripts/bench/benchmark.js:87–99  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

85}
86
87async function initChrome() {
88 const platform = os.platform();
89
90 if (platform === 'linux') {
91 process.env.XVFBARGS = '-screen 0, 1024x768x16';
92 process.env.LIGHTHOUSE_CHROMIUM_PATH = 'chromium-browser';
93 const child = spawn('xvfb start', [{detached: true, stdio: ['ignore']}]);
94 child.unref();
95 // wait for chrome to load then continue
96 await wait(3000);
97 return child;
98 }
99}
100
101async function launchChrome(headless) {
102 return await chromeLauncher.launch({

Callers 1

runBenchmarkFunction · 0.85

Calls 1

waitFunction · 0.70

Tested by

no test coverage detected