Skip to content

Commit

Permalink
[CloudOpenMetrics] Detect WrongValueLogged state in switch statement
Browse files Browse the repository at this point in the history
Use switch statements instead of `base::Contains()` to check if a metric
was logged with the wrong value.

This guarantees that the CloudOpenMetrics object will be updated when
any enums are expanded because Chrome cannot be compiled otherwise.

Remove the Metric methods:
- IsNotLoggedWith()
- IsLoggedWith()

Remove CloudOpenMetrics methods:
- ExpectNotLoggedWith()
- ExpectLoggedWith()

Introduce CloudOpenMetrics::SetWrongValueLogged() to update the metric
state and print debug information.

Also, expand the check for drive_open_error_ when task_result_
is kFallbackQuickOffice or kCancelledAtFallback to accommodate
extra enums added.

Bug: b/300861997
Change-Id: I139af3ee3ddb73f8c540aedb96b4193425927ab6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4974771
Commit-Queue: Cassy Chun-Crogan <cassycc@google.com>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1216767}
  • Loading branch information
cassycc authored and Chromium LUCI CQ committed Oct 30, 2023
1 parent 00014ba commit d281501
Show file tree
Hide file tree
Showing 3 changed files with 296 additions and 143 deletions.

0 comments on commit d281501

Please sign in to comment.