Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1363)

Unified Diff: chrome/install_static/product_install_details_unittest.cc

Issue 2797433002: Include Google Update integration details in crash keys and about:version. (Closed)
Patch Set: components/version_ui/OWNERS now own version_ui_strings.grdp Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/install_static/product_install_details_unittest.cc
diff --git a/chrome/install_static/product_install_details_unittest.cc b/chrome/install_static/product_install_details_unittest.cc
index c64c9006c3cd972193f34ddd07dc4972b3fa9b76..582921db2a1a49a6602e1e7ba763994db038f8da 100644
--- a/chrome/install_static/product_install_details_unittest.cc
+++ b/chrome/install_static/product_install_details_unittest.cc
@@ -195,6 +195,15 @@ class MakeProductDetailsTest : public testing::TestWithParam<TestData> {
Eq(ERROR_SUCCESS));
}
+ void SetCohortName(const wchar_t* value) {
+ ASSERT_THAT(
+ base::win::RegKey(root_key_,
+ GetClientStateKeyPath().append(L"\\cohort").c_str(),
+ KEY_WOW64_32KEY | KEY_SET_VALUE)
+ .WriteValue(L"name", value),
+ Eq(ERROR_SUCCESS));
+ }
+
private:
// Returns the registry path for the product's ClientState key.
std::wstring GetClientStateKeyPath() {
@@ -290,6 +299,52 @@ TEST_P(MakeProductDetailsTest, AdditionalParametersChannels) {
}
}
+// Test that the "ap" value is cached during initialization.
+TEST_P(MakeProductDetailsTest, UpdateAp) {
+ // This test is only valid for brands that integrate with Google Update.
+ if (!kUseGoogleUpdateIntegration)
+ return;
+
+ // With no value in the registry, the ap value should be empty.
+ {
+ std::unique_ptr<PrimaryInstallDetails> details(
+ MakeProductDetails(test_data().path));
+ EXPECT_THAT(details->update_ap(), StrEq(L""));
+ }
+
+ // And with a value, it should have ... the value.
+ static constexpr wchar_t kCrookedMoon[] = L"CrookedMoon";
+ SetAp(kCrookedMoon);
+ {
+ std::unique_ptr<PrimaryInstallDetails> details(
+ MakeProductDetails(test_data().path));
+ EXPECT_THAT(details->update_ap(), StrEq(kCrookedMoon));
+ }
+}
+
+// Test that the cohort name is cached during initialization.
+TEST_P(MakeProductDetailsTest, UpdateCohortName) {
+ // This test is only valid for brands that integrate with Google Update.
+ if (!kUseGoogleUpdateIntegration)
+ return;
+
+ // With no value in the registry, the cohort name should be empty.
+ {
+ std::unique_ptr<PrimaryInstallDetails> details(
+ MakeProductDetails(test_data().path));
+ EXPECT_THAT(details->update_cohort_name(), StrEq(L""));
+ }
+
+ // And with a value, it should have ... the value.
+ static constexpr wchar_t kPhony[] = L"Phony";
+ SetCohortName(kPhony);
+ {
+ std::unique_ptr<PrimaryInstallDetails> details(
+ MakeProductDetails(test_data().path));
+ EXPECT_THAT(details->update_cohort_name(), StrEq(kPhony));
+ }
+}
+
INSTANTIATE_TEST_CASE_P(All,
MakeProductDetailsTest,
testing::ValuesIn(kTestData));
« no previous file with comments | « chrome/install_static/product_install_details.cc ('k') | chrome/installer/setup/installer_crash_reporting.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698