Currently in model.mojom we have:
enum ModelId {
UNKNOWN,
TEST_MODEL,
SMART_DIM,
kMax = SMART_DIM,
};
Reasons for UNKNOWN and kMax:
* We use the UNKNOWN in a check for out-of-range model IDs, and in a unit test of that check.
* We use the kMax in that check too, and the kMax is also needed (for eg Uma logging).
However it turns out that Mojo already validates enum values, so we shouldn't need the check. So we should remove UNKNOWN and update the unit test.
Also, after the next Mojo uprev, Mojo will generate a max value for us in the enum and we can remove kMax.
Rough steps:
1. Update the enum to have explicit values for the models. TEST_MODEL = 1 etc.
2. Remove UNKNOWN. Update the unit test to pass an invalid numerical value like 0 or -5, with the expected behaviour being no-response.
3. Propagate both the above changes to Chromium repo.
4. Wait for Mojo uprev.
5. Remove kMax.
Comment 1 by amoylan@chromium.org
, Dec 20