Commit 3c3c4c31 authored by Trent Begin's avatar Trent Begin Committed by Commit Bot

cros_healthd: sync mojom files

The chrome mojom files for cros_healthd have gotten out of sync. This CL
adds the following:
- NetworkResult to the telemetry probe
- kServiceUnavailable to probe error enum
- kUnsupported to the routine status enum

Bug: chromium:1084663, chromium:1115524
Change-Id: Ida1c79fb872152bf94bd77cbcfd33c9473a39279
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2346916
Commit-Queue: Trent Begin <tbegin@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarPaul Moy <pmoy@chromium.org>
Reviewed-by: default avatarOleh Lamzin <lamzin@google.com>
Cr-Commit-Position: refs/heads/master@{#800367}
parent ef866f1c
...@@ -71,6 +71,8 @@ health::mojom::DiagnosticRoutineStatusEnum Convert( ...@@ -71,6 +71,8 @@ health::mojom::DiagnosticRoutineStatusEnum Convert(
return health::mojom::DiagnosticRoutineStatusEnum::kRemoved; return health::mojom::DiagnosticRoutineStatusEnum::kRemoved;
case cros_healthd::mojom::DiagnosticRoutineStatusEnum::kCancelling: case cros_healthd::mojom::DiagnosticRoutineStatusEnum::kCancelling:
return health::mojom::DiagnosticRoutineStatusEnum::kCancelling; return health::mojom::DiagnosticRoutineStatusEnum::kCancelling;
case cros_healthd::mojom::DiagnosticRoutineStatusEnum::kUnsupported:
return health::mojom::DiagnosticRoutineStatusEnum::kUnsupported;
} }
NOTREACHED(); NOTREACHED();
return static_cast<health::mojom::DiagnosticRoutineStatusEnum>( return static_cast<health::mojom::DiagnosticRoutineStatusEnum>(
......
...@@ -35,6 +35,8 @@ TEST(DiagnosticsServiceConvertersTest, ConvertDiagnosticRoutineStatusEnum) { ...@@ -35,6 +35,8 @@ TEST(DiagnosticsServiceConvertersTest, ConvertDiagnosticRoutineStatusEnum) {
health::DiagnosticRoutineStatusEnum::kRemoved); health::DiagnosticRoutineStatusEnum::kRemoved);
EXPECT_EQ(Convert(cros_healthd::DiagnosticRoutineStatusEnum::kCancelling), EXPECT_EQ(Convert(cros_healthd::DiagnosticRoutineStatusEnum::kCancelling),
health::DiagnosticRoutineStatusEnum::kCancelling); health::DiagnosticRoutineStatusEnum::kCancelling);
EXPECT_EQ(Convert(cros_healthd::DiagnosticRoutineStatusEnum::kUnsupported),
health::DiagnosticRoutineStatusEnum::kUnsupported);
} }
TEST(DiagnosticsServiceConvertersTest, TEST(DiagnosticsServiceConvertersTest,
......
...@@ -75,6 +75,7 @@ enum DiagnosticRoutineStatusEnum { ...@@ -75,6 +75,7 @@ enum DiagnosticRoutineStatusEnum {
kFailedToStart = 7, // Routine could not be created. kFailedToStart = 7, // Routine could not be created.
kRemoved = 8, // Routine has been removed and is no longer valid. kRemoved = 8, // Routine has been removed and is no longer valid.
kCancelling = 9, // Routine is in the process of being cancelled. kCancelling = 9, // Routine is in the process of being cancelled.
kUnsupported = 10, // Routine is not supported by the device.
}; };
// Enumeration of each of the messages a diagnostics routine can pass back. // Enumeration of each of the messages a diagnostics routine can pass back.
......
...@@ -88,6 +88,8 @@ enum ErrorType { ...@@ -88,6 +88,8 @@ enum ErrorType {
kParseError, kParseError,
// An error using a system utility. // An error using a system utility.
kSystemUtilityError, kSystemUtilityError,
// The external service used to probe the information is not available.
kServiceUnavailable,
}; };
// Structure that contains error information for a telemetry probe. // Structure that contains error information for a telemetry probe.
......
...@@ -336,6 +336,8 @@ health::mojom::ErrorType Convert(cros_healthd::mojom::ErrorType input) { ...@@ -336,6 +336,8 @@ health::mojom::ErrorType Convert(cros_healthd::mojom::ErrorType input) {
return health::mojom::ErrorType::kParseError; return health::mojom::ErrorType::kParseError;
case cros_healthd::mojom::ErrorType::kSystemUtilityError: case cros_healthd::mojom::ErrorType::kSystemUtilityError:
return health::mojom::ErrorType::kSystemUtilityError; return health::mojom::ErrorType::kSystemUtilityError;
case cros_healthd::mojom::ErrorType::kServiceUnavailable:
return health::mojom::ErrorType::kServiceUnavailable;
} }
NOTREACHED(); NOTREACHED();
} }
......
...@@ -65,6 +65,9 @@ TEST(ProbeServiceConvertors, ErrorType) { ...@@ -65,6 +65,9 @@ TEST(ProbeServiceConvertors, ErrorType) {
EXPECT_EQ(Convert(cros_healthd::mojom::ErrorType::kSystemUtilityError), EXPECT_EQ(Convert(cros_healthd::mojom::ErrorType::kSystemUtilityError),
health::mojom::ErrorType::kSystemUtilityError); health::mojom::ErrorType::kSystemUtilityError);
EXPECT_EQ(Convert(cros_healthd::mojom::ErrorType::kServiceUnavailable),
health::mojom::ErrorType::kServiceUnavailable);
} }
TEST(ProbeServiceConvertors, ProbeErrorPtr) { TEST(ProbeServiceConvertors, ProbeErrorPtr) {
......
...@@ -99,6 +99,7 @@ class DiagnosticsProxy { ...@@ -99,6 +99,7 @@ class DiagnosticsProxy {
[statusEnum.kFailedToStart, 'failed-to-start'], [statusEnum.kFailedToStart, 'failed-to-start'],
[statusEnum.kRemoved, 'removed'], [statusEnum.kRemoved, 'removed'],
[statusEnum.kCancelling, 'cancelling'], [statusEnum.kCancelling, 'cancelling'],
[statusEnum.kUnsupported, 'unsupported'],
]); ]);
if (this.enumToStatus_.size !== statusEnum.MAX_VALUE + 1) { if (this.enumToStatus_.size !== statusEnum.MAX_VALUE + 1) {
......
...@@ -101,6 +101,8 @@ TEST_F('TelemetryExtensionUIBrowserTest', 'ConvertDiagnosticsEnums', () => { ...@@ -101,6 +101,8 @@ TEST_F('TelemetryExtensionUIBrowserTest', 'ConvertDiagnosticsEnums', () => {
assertEquals(diagnosticsProxy.convertStatus(statusEnum.kRemoved), 'removed'); assertEquals(diagnosticsProxy.convertStatus(statusEnum.kRemoved), 'removed');
assertEquals( assertEquals(
diagnosticsProxy.convertStatus(statusEnum.kCancelling), 'cancelling'); diagnosticsProxy.convertStatus(statusEnum.kCancelling), 'cancelling');
assertEquals(
diagnosticsProxy.convertStatus(statusEnum.kUnsupported), 'unsupported');
// Unit tests for convertUserMessage // Unit tests for convertUserMessage
const userMessageEnum = const userMessageEnum =
......
...@@ -52,6 +52,7 @@ enum DiagnosticRoutineStatusEnum { ...@@ -52,6 +52,7 @@ enum DiagnosticRoutineStatusEnum {
kFailedToStart = 7, // Routine could not be created. kFailedToStart = 7, // Routine could not be created.
kRemoved = 8, // Routine has been removed and is no longer valid. kRemoved = 8, // Routine has been removed and is no longer valid.
kCancelling = 9, // Routine is in the process of being cancelled. kCancelling = 9, // Routine is in the process of being cancelled.
kUnsupported = 10, // Routine is not supported by the device.
}; };
// Enumeration of each of the messages a diagnostics routine can pass back. // Enumeration of each of the messages a diagnostics routine can pass back.
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
module chromeos.cros_healthd.mojom; module chromeos.cros_healthd.mojom;
import "chromeos/services/network_health/public/mojom/network_health.mojom";
// An enumeration of CPU architectures. // An enumeration of CPU architectures.
[Extensible] [Extensible]
enum CpuArchitectureEnum { enum CpuArchitectureEnum {
...@@ -32,6 +34,7 @@ enum ProbeCategoryEnum { ...@@ -32,6 +34,7 @@ enum ProbeCategoryEnum {
kStatefulPartition, kStatefulPartition,
kBluetooth, kBluetooth,
kSystem, kSystem,
kNetwork,
}; };
// An enumeration of the different categories of errors that can occur when // An enumeration of the different categories of errors that can occur when
...@@ -44,6 +47,8 @@ enum ErrorType { ...@@ -44,6 +47,8 @@ enum ErrorType {
kParseError, kParseError,
// An error using a system utility. // An error using a system utility.
kSystemUtilityError, kSystemUtilityError,
// The external service used to probe the information is not available.
kServiceUnavailable,
}; };
// Structure that contains error information for a telemetry probe. // Structure that contains error information for a telemetry probe.
...@@ -453,6 +458,15 @@ struct SystemInfo { ...@@ -453,6 +458,15 @@ struct SystemInfo {
string? product_name; string? product_name;
}; };
// Network probe result. Can either be populated with the NetworkHealthSnapshot
// or an error retrieving the information.
union NetworkResult {
// Valid NetworkHealthSnapshot.
chromeos.network_health.mojom.NetworkHealthState network_health;
// The error that occurred attempting to retrieve the NetworkHealthSnapshot.
ProbeError error;
};
// A collection of all the device's telemetry information that cros_healthd is // A collection of all the device's telemetry information that cros_healthd is
// capable of reporting. Note that every field in TelemetryInfo is nullable, and // capable of reporting. Note that every field in TelemetryInfo is nullable, and
// the response for a particular ProbeTelemetryInfo request will only contain // the response for a particular ProbeTelemetryInfo request will only contain
...@@ -493,4 +507,8 @@ struct TelemetryInfo { ...@@ -493,4 +507,8 @@ struct TelemetryInfo {
// Information about the system from various sources. Only present when // Information about the system from various sources. Only present when
// kSystem was included in the categories input to ProbeTelemetryInfo. // kSystem was included in the categories input to ProbeTelemetryInfo.
SystemResult? system_result; SystemResult? system_result;
// Information about the networking devices and associated networks of the
// system. Only present when kNetwork was included in the categories input to
// ProbeTelemetryInfo.
NetworkResult? network_result;
}; };
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