提交

fix: Fix throttling info in performance trace output (#2096)

This addresses #1955.

Throttling information needs to be passed to the parser for the output
to be correct.
这个提交包含在:
Wolfgang Beyer
2026-05-22 10:08:56 +02:00
提交者 GitHub
父节点 3ade962a8d
当前提交 57f32b0cd4
修改 4 个文件,包含 53 行新增8 行删除
@@ -106,4 +106,41 @@ describe('chrome-devtools', () => {
'restart command suggestion is miss: ' + result.stdout,
);
});
it('can record a performance trace', async () => {
const startResult = await runCli(
['start', '--performanceCrux=false'],
sessionId,
);
assert.strictEqual(
startResult.status,
0,
`start command failed: ${startResult.stderr}`,
);
const emulateResult = await runCli(
['emulate', '--cpuThrottlingRate', '2'],
sessionId,
);
assert.strictEqual(
emulateResult.status,
0,
`emulate command failed: ${emulateResult.stderr}`,
);
const result = await runCli(['performance_start_trace'], sessionId);
assert.strictEqual(
result.status,
0,
`performance_start_trace command failed: ${result.stderr}`,
);
assert(
result.stdout.includes('The performance trace has been stopped.'),
'performance_start_trace output is unexpected: ' + result.stdout,
);
assert(
result.stdout.includes('CPU throttling: 2x'),
'performance_start_trace output is unexpected: ' + result.stdout,
);
});
});