Fix test-speedometer (#34072)

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
Samson 2024-10-30 18:59:15 +01:00 committed by GitHub
parent ade562e481
commit cf66330978
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -529,8 +529,8 @@ class MachCommands(CommandBase):
binary,
"https://servospeedometer.netlify.app?headless=1",
"--pref", "dom.allow_scripts_to_close_windows",
"--resolution=1100x900",
"--headless"], timeout=60).decode())
"--window-size=1100x900",
"--headless"], timeout=120).decode())
print(f"Score: {speedometer['Score']['mean']} ± {speedometer['Score']['delta']}")
@ -538,6 +538,7 @@ class MachCommands(CommandBase):
output = dict()
def parse_speedometer_result(result):
if result['unit'] == "ms":
output[f"Speedometer/{result['name']}"] = {
'latency': { # speedometer has ms we need to convert to ns
'value': float(result['mean']) * 1000.0,
@ -545,6 +546,17 @@ class MachCommands(CommandBase):
'upper_value': float(result['max']) * 1000.0,
}
}
elif result['unit'] == "score":
output[f"Speedometer/{result['name']}"] = {
'score': {
'value': float(result['mean']),
'lower_value': float(result['min']),
'upper_value': float(result['max']),
}
}
else:
raise "Unknown unit!"
for child in result['children']:
parse_speedometer_result(child)