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

Unified Diff: chrome/installer/setup/setup_util_unittest.cc

Issue 2507753002: Install the chrome event log provider together with the browser. (Closed)
Patch Set: Fix RegisterEventLogProvider unit test. Created 4 years 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/installer/setup/setup_util_unittest.cc
diff --git a/chrome/installer/setup/setup_util_unittest.cc b/chrome/installer/setup/setup_util_unittest.cc
index eb62820e9c71c82078096257e982472c3b92cf5e..e35061d2130768cefedf0e95575d3013a5e2d377 100644
--- a/chrome/installer/setup/setup_util_unittest.cc
+++ b/chrome/installer/setup/setup_util_unittest.cc
@@ -193,6 +193,48 @@ TEST(SetupUtilTest, GuidToSquid) {
L"3E026ADE89AA64838BE14339BCE2E020");
}
+TEST(SetupUtilTest, RegisterEventLogProvider) {
+ registry_util::RegistryOverrideManager registry_override_manager;
+ registry_override_manager.OverrideRegistry(HKEY_LOCAL_MACHINE);
+
+ const base::Version version("1.2.3.4");
+ const base::FilePath install_directory(
+ FILE_PATH_LITERAL("c:\\some_path\\test"));
+ installer::RegisterEventLogProvider(install_directory, version);
+
+ // TODO(grt): use install_static::InstallDetails::Get().install_full_name()
+ // when InstallDetails is initialized in the installer.
+ base::string16 reg_path(
+ L"SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\");
+#if defined(GOOGLE_CHROME_BUILD)
+ reg_path.append(L"Chrome");
+ if (InstallUtil::IsChromeSxSProcess())
+ reg_path.append(L" SxS");
+#else
+ reg_path.append(L"Chromium");
+#endif
+ base::win::RegKey key;
+ ASSERT_EQ(ERROR_SUCCESS,
+ key.Open(HKEY_LOCAL_MACHINE, reg_path.c_str(), KEY_READ));
+ EXPECT_TRUE(key.HasValue(L"CategoryCount"));
+ EXPECT_TRUE(key.HasValue(L"TypesSupported"));
+ EXPECT_TRUE(key.HasValue(L"CategoryMessageFile"));
+ EXPECT_TRUE(key.HasValue(L"EventMessageFile"));
+ EXPECT_TRUE(key.HasValue(L"ParameterMessageFile"));
+ base::string16 value;
+ EXPECT_EQ(ERROR_SUCCESS, key.ReadValue(L"CategoryMessageFile", &value));
+ const base::FilePath expected_directory(
+ install_directory.AppendASCII(version.GetString()));
+ const base::FilePath provider_path(value);
+ EXPECT_EQ(expected_directory, provider_path.DirName());
+ key.Close();
+
+ installer::DeRegisterEventLogProvider();
+
+ EXPECT_NE(ERROR_SUCCESS,
+ key.Open(HKEY_LOCAL_MACHINE, reg_path.c_str(), KEY_READ));
+}
+
const char kAdjustProcessPriority[] = "adjust-process-priority";
PriorityClassChangeResult DoProcessPriorityAdjustment() {

Powered by Google App Engine
This is Rietveld 408576698