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

Unified Diff: chrome/install_static/install_util_unittest.cc

Issue 2718063002: Use install_static::GetAppGuid in place of BrowserDistribution and AppRegistrationData. (Closed)
Patch Set: huangs feedback plus Chromium test fix Created 3 years, 10 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
« no previous file with comments | « chrome/install_static/install_util.cc ('k') | chrome/installer/util/app_registration_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/install_static/install_util_unittest.cc
diff --git a/chrome/install_static/install_util_unittest.cc b/chrome/install_static/install_util_unittest.cc
index 8e8f7b9ffe490e0e583c4e2316c6a0977be2d51f..1f9b1640722811971641b903b1dd99b82023c89d 100644
--- a/chrome/install_static/install_util_unittest.cc
+++ b/chrome/install_static/install_util_unittest.cc
@@ -6,6 +6,7 @@
#include <tuple>
+#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/test/test_reg_util_win.h"
#include "chrome/install_static/install_details.h"
@@ -16,6 +17,7 @@
#include "testing/gtest/include/gtest/gtest.h"
using ::testing::ElementsAre;
+using ::testing::StrCaseEq;
namespace install_static {
@@ -341,6 +343,28 @@ class InstallStaticUtilTest
DISALLOW_COPY_AND_ASSIGN(InstallStaticUtilTest);
};
+TEST_P(InstallStaticUtilTest, GetAppGuid) {
+ // For brands that do not integrate with Omaha/Google Update, the app guid is
+ // an empty string.
+ if (!kUseGoogleUpdateIntegration) {
+ EXPECT_STREQ(L"", GetAppGuid());
+ return;
+ }
+
+#if defined(GOOGLE_CHROME_BUILD)
+ // The app guids for the brand's install modes; parallel to kInstalLModes.
+ static constexpr const wchar_t* kAppGuids[] = {
+ L"{8A69D345-D564-463c-AFF1-A69D9E530F96}", // Google Chrome.
+ L"{4EA16AC7-FD5A-47C3-875B-DBF4A2008C20}", // Google Chrome SxS (Canary).
+ };
+ static_assert(arraysize(kAppGuids) == NUM_INSTALL_MODES,
+ "kAppGuids out of date.");
+ EXPECT_THAT(GetAppGuid(), StrCaseEq(kAppGuids[std::get<0>(GetParam())]));
+#else
+ FAIL() << "Not implemented.";
+#endif
+}
+
TEST_P(InstallStaticUtilTest, UsageStatsAbsent) {
EXPECT_FALSE(GetCollectStatsConsent());
}
« no previous file with comments | « chrome/install_static/install_util.cc ('k') | chrome/installer/util/app_registration_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698