Skip to content

Commit

Permalink
UMA: Read proper default key value instead of "id" for cohort ID.
Browse files Browse the repository at this point in the history
(cherry picked from commit d82dfe4)

Fixed: 1473054
Change-Id: I8ce289bd5b174b540d8f69f42cc42b085016da66
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4892211
Auto-Submit: Joshua Pawlicki <waffles@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Greg Thompson <grt@chromium.org>
Commit-Queue: Greg Thompson <grt@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1201934}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4903849
Commit-Queue: Joshua Pawlicki <waffles@chromium.org>
Reviewed-by: Sorin Jianu <sorin@chromium.org>
Cr-Commit-Position: refs/branch-heads/5993@{#973}
Cr-Branched-From: 5113507-refs/heads/main@{#1192594}
  • Loading branch information
Joshua Pawlicki authored and Chromium LUCI CQ committed Sep 29, 2023
1 parent 649d8e4 commit 429211a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion chrome/installer/util/google_update_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ const wchar_t kRegCleanInstallRequiredForVersionBelowField[] =
const wchar_t kRegClientField[] = L"client";
const wchar_t kRegCommandLineField[] = L"CommandLine";
const wchar_t kRegCriticalVersionField[] = L"cpv";
const wchar_t kRegDefaultField[] = L"";
const wchar_t kRegDidRunField[] = L"dr";
const wchar_t kRegDowngradeCleanupCommandField[] = L"DowngradeCleanupCommand";
const wchar_t kRegEulaAceptedField[] = L"eulaaccepted";
const wchar_t kRegGoogleUpdateVersion[] = L"version";
const wchar_t kRegIdField[] = L"id";
const wchar_t kRegInstallerProgress[] = L"InstallerProgress";
const wchar_t kRegLangField[] = L"lang";
const wchar_t kRegLastStartedAUField[] = L"LastStartedAU";
Expand Down
2 changes: 1 addition & 1 deletion chrome/installer/util/google_update_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ extern const wchar_t kRegCleanInstallRequiredForVersionBelowField[];
extern const wchar_t kRegClientField[];
extern const wchar_t kRegCommandLineField[];
extern const wchar_t kRegCriticalVersionField[];
extern const wchar_t kRegDefaultField[];
extern const wchar_t kRegDidRunField[];
extern const wchar_t kRegDowngradeCleanupCommandField[];
extern const wchar_t kRegEulaAceptedField[];
extern const wchar_t kRegGoogleUpdateVersion[];
extern const wchar_t kRegIdField[];
extern const wchar_t kRegInstallerProgress[];
extern const wchar_t kRegLangField[];
extern const wchar_t kRegLastStartedAUField[];
Expand Down
2 changes: 1 addition & 1 deletion chrome/installer/util/google_update_settings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ GoogleUpdateSettings::LoadMetricsClientInfo() {
// static
absl::optional<uint32_t> GoogleUpdateSettings::GetHashedCohortId() {
absl::optional<std::wstring> id =
ReadGoogleUpdateCohortStrKey(google_update::kRegIdField);
ReadGoogleUpdateCohortStrKey(google_update::kRegDefaultField);
if (!id) {
return absl::nullopt;
}
Expand Down
4 changes: 2 additions & 2 deletions chrome/installer/util/google_update_settings_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ TEST_F(GoogleUpdateSettingsTest, GetHashedCohortIdTestEmptyValue) {
.append(L"\\cohort")
.c_str(),
KEY_SET_VALUE)
.WriteValue(google_update::kRegIdField, L"");
.WriteValue(google_update::kRegDefaultField, L"");
EXPECT_FALSE(GoogleUpdateSettings::GetHashedCohortId());
}

Expand All @@ -880,7 +880,7 @@ TEST_F(GoogleUpdateSettingsTest, GetHashedCohortIdTestRealValue) {
.append(L"\\cohort")
.c_str(),
KEY_SET_VALUE)
.WriteValue(google_update::kRegIdField, L"1:qesc2/qesff:qesee@0.5");
.WriteValue(google_update::kRegDefaultField, L"1:qesc2/qesff:qesee@0.5");
EXPECT_TRUE(GoogleUpdateSettings::GetHashedCohortId());
EXPECT_EQ(*GoogleUpdateSettings::GetHashedCohortId(),
base::PersistentHash("1:qesc2/qesff"));
Expand Down

0 comments on commit 429211a

Please sign in to comment.