Commit 9844896a authored by Oleh Lamzin's avatar Oleh Lamzin Committed by Commit Bot

[Telemetry SWX] add partition info browser test

Bug: b:158658869
Change-Id: Ie366422199576e352185d9f8877a8944dbdcad8f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2387645
Commit-Queue: Oleh Lamzin <lamzin@google.com>
Reviewed-by: default avatarMahmoud Gawad <mgawad@google.com>
Cr-Commit-Position: refs/heads/master@{#803648}
parent 8f78feec
...@@ -297,6 +297,15 @@ void TelemetryExtensionUiBrowserTest::SetUpOnMainThread() { ...@@ -297,6 +297,15 @@ void TelemetryExtensionUiBrowserTest::SetUpOnMainThread() {
telemetry_info->fan_result = telemetry_info->fan_result =
chromeos::cros_healthd::mojom::FanResult::NewFanInfo(std::move(infos)); chromeos::cros_healthd::mojom::FanResult::NewFanInfo(std::move(infos));
} }
{
auto partition_info =
chromeos::cros_healthd::mojom::StatefulPartitionInfo::New();
partition_info->available_space = 1125899906842624;
partition_info->total_space = 1125900006842624;
telemetry_info->stateful_partition_result = chromeos::cros_healthd::mojom::
StatefulPartitionResult::NewPartitionInfo(std::move(partition_info));
}
DCHECK(chromeos::cros_healthd::FakeCrosHealthdClient::Get()); DCHECK(chromeos::cros_healthd::FakeCrosHealthdClient::Get());
......
...@@ -153,6 +153,10 @@ UNTRUSTED_TEST('UntrustedRequestTelemetryInfo', async () => { ...@@ -153,6 +153,10 @@ UNTRUSTED_TEST('UntrustedRequestTelemetryInfo', async () => {
'timezone', 'memory', 'backlight', 'fan', 'stateful-partition', 'bluetooth' 'timezone', 'memory', 'backlight', 'fan', 'stateful-partition', 'bluetooth'
]); ]);
// Rounded down to the nearest 100MiB due to privacy requirement.
const availableSpace =
Math.floor(1125899906842624 / (100 * 1024 * 1024)) * (100 * 1024 * 1024);
assertDeepEquals(response, { assertDeepEquals(response, {
batteryResult: { batteryResult: {
batteryInfo: { batteryInfo: {
...@@ -245,6 +249,12 @@ UNTRUSTED_TEST('UntrustedRequestTelemetryInfo', async () => { ...@@ -245,6 +249,12 @@ UNTRUSTED_TEST('UntrustedRequestTelemetryInfo', async () => {
fanInfo: [{ fanInfo: [{
speedRpm: 999880912, speedRpm: 999880912,
}] }]
},
statefulPartitionResult: {
partitionInfo: {
availableSpace: availableSpace,
totalSpace: 1125900006842624,
}
} }
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment