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

Unified Diff: chrome/installer/util/installer_state_unittest.cc

Issue 521703002: Fix ProductTest.ProductInstallBasic and InstallerStateTest.InitializeTwice flakes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@regtest
Patch Set: fix for xp Created 6 years, 4 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 | « no previous file | chrome/installer/util/product_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/installer_state_unittest.cc
diff --git a/chrome/installer/util/installer_state_unittest.cc b/chrome/installer/util/installer_state_unittest.cc
index b3db8b39bd842bbbeb32c95d4a899b15a0e71531..1c8fd651aa39434bf90942e354be55c873c09f1a 100644
--- a/chrome/installer/util/installer_state_unittest.cc
+++ b/chrome/installer/util/installer_state_unittest.cc
@@ -15,6 +15,7 @@
#include "base/path_service.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/test/scoped_path_override.h"
#include "base/test/test_reg_util_win.h"
#include "base/version.h"
#include "base/win/registry.h"
@@ -603,6 +604,22 @@ TEST_F(InstallerStateTest, RemoveOldVersionDirs) {
}
TEST_F(InstallerStateTest, InitializeTwice) {
+ // Override these paths so that they can be found after the registry override
+ // manager is in place.
+ base::FilePath temp;
+ PathService::Get(base::DIR_PROGRAM_FILES, &temp);
+ base::ScopedPathOverride program_files_override(base::DIR_PROGRAM_FILES,
+ temp);
+ PathService::Get(base::DIR_PROGRAM_FILESX86, &temp);
+ base::ScopedPathOverride program_filesx86_override(base::DIR_PROGRAM_FILESX86,
+ temp);
+ PathService::Get(base::DIR_LOCAL_APP_DATA, &temp);
+ base::ScopedPathOverride local_app_data_override(base::DIR_LOCAL_APP_DATA,
+ temp);
+ registry_util::RegistryOverrideManager override_manager;
+ override_manager.OverrideRegistry(HKEY_CURRENT_USER, base::string16());
+ override_manager.OverrideRegistry(HKEY_LOCAL_MACHINE, base::string16());
+
InstallationState machine_state;
machine_state.Initialize();
« no previous file with comments | « no previous file | chrome/installer/util/product_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698