Remove alternate hosts from tooling probes
Keep the probe suite on the Material composition so browser fixtures and capture drivers no longer render or select Cupertino hosts. Record the final residual legacy arguments and implementation checks for the delivery gate.
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
//
|
||||
// node tool/perf/glass_scroll_bench.mjs --build build/probe-app \
|
||||
// --out /tmp/perf-glass/before [--gpu] [--size 560x900] [--seconds 6] \
|
||||
// [--repeat 3] [--platform material|cupertino] [--theme light|dark] \
|
||||
// [--repeat 3] [--theme light|dark] \
|
||||
// [--shots] [--only runs-list|run-timeline] [--flags="<extra Chrome flags>"]
|
||||
//
|
||||
// Per scenario (the Runs list: 3 glass pieces; a run's Timeline tab: 5) it
|
||||
@@ -34,7 +34,7 @@ const { values: opts } = parseArgs({
|
||||
options: {
|
||||
build: { type: 'string' }, out: { type: 'string' }, gpu: { type: 'boolean' },
|
||||
size: { type: 'string', default: '560x900' }, seconds: { type: 'string', default: '6' },
|
||||
repeat: { type: 'string', default: '3' }, platform: { type: 'string', default: 'material' },
|
||||
repeat: { type: 'string', default: '3' },
|
||||
theme: { type: 'string', default: 'light' }, only: { type: 'string' },
|
||||
flags: { type: 'string', default: '' }, shots: { type: 'boolean' },
|
||||
},
|
||||
@@ -127,7 +127,7 @@ const chrome = await launchChrome();
|
||||
const browser = await openBrowser({ cdp: chrome.cdp });
|
||||
const { send } = browser;
|
||||
const evaluate = async (expression) => (await send('Runtime.evaluate', { expression, returnByValue: true, awaitPromise: true })).result.value;
|
||||
const results = { build: opts.build, gpu: Boolean(opts.gpu), size: opts.size, platform: opts.platform, theme: opts.theme, scenarios: {} };
|
||||
const results = { build: opts.build, gpu: Boolean(opts.gpu), size: opts.size, theme: opts.theme, scenarios: {} };
|
||||
try {
|
||||
await send('Page.enable');
|
||||
await send('Runtime.enable');
|
||||
@@ -143,7 +143,6 @@ try {
|
||||
for (let rep = 0; rep < Number(opts.repeat); rep++) {
|
||||
const url = new URL('/', server.origin);
|
||||
url.searchParams.set('route', s.route);
|
||||
url.searchParams.set('platform', opts.platform);
|
||||
url.searchParams.set('theme', opts.theme);
|
||||
for (const [k, v] of Object.entries(s.extra)) url.searchParams.set(k, v);
|
||||
await send('Page.navigate', { url: url.href });
|
||||
@@ -167,19 +166,19 @@ try {
|
||||
await send('Input.dispatchMouseEvent', { type: 'mouseMoved', x: 1, y: height / 2 });
|
||||
await delay(1500);
|
||||
const still = (await send('Page.captureScreenshot', { format: 'png' })).data;
|
||||
await writeFile(join(opts.out, `${s.name}-${opts.platform}-${opts.theme}-still.png`), Buffer.from(still, 'base64'));
|
||||
await writeFile(join(opts.out, `${s.name}-${opts.theme}-still.png`), Buffer.from(still, 'base64'));
|
||||
break;
|
||||
}
|
||||
const frames = await evaluate(`window.__bench.drive(${Number(opts.seconds) * 1000}, ${x}, ${y}, 6)`);
|
||||
runs.push({ ...summarise(frames), census });
|
||||
await delay(500);
|
||||
const shot = rep === 0 ? (await send('Page.captureScreenshot', { format: 'png' })).data : null;
|
||||
if (shot) await writeFile(join(opts.out, `${s.name}-${opts.platform}-${opts.theme}.png`), Buffer.from(shot, 'base64'));
|
||||
if (shot) await writeFile(join(opts.out, `${s.name}-${opts.theme}.png`), Buffer.from(shot, 'base64'));
|
||||
}
|
||||
results.scenarios[s.name] = runs;
|
||||
console.log(s.name, JSON.stringify(runs));
|
||||
}
|
||||
if (!opts.shots) await writeFile(join(opts.out, `bench-${opts.gpu ? 'gpu' : 'sw'}-${opts.platform}-${opts.theme}.json`), JSON.stringify(results, null, 2));
|
||||
if (!opts.shots) await writeFile(join(opts.out, `bench-${opts.gpu ? 'gpu' : 'sw'}-${opts.theme}.json`), JSON.stringify(results, null, 2));
|
||||
} finally {
|
||||
await browser.close().catch(() => {});
|
||||
await chrome.close();
|
||||
|
||||
Reference in New Issue
Block a user