| Index: chrome/installer/util/installer_state_unittest.cc
|
| ===================================================================
|
| --- chrome/installer/util/installer_state_unittest.cc (revision 97629)
|
| +++ chrome/installer/util/installer_state_unittest.cc (working copy)
|
| @@ -13,6 +13,7 @@
|
| #include "base/process_util.h"
|
| #include "base/scoped_temp_dir.h"
|
| #include "base/string_util.h"
|
| +#include "base/test/test_reg_util_win.h"
|
| #include "base/utf_string_conversions.h"
|
| #include "base/version.h"
|
| #include "base/win/registry.h"
|
| @@ -35,6 +36,8 @@
|
| using installer::InstallationState;
|
| using installer::InstallerState;
|
| using installer::MasterPreferences;
|
| +using registry_util::ScopedRegistryKeyOverride;
|
| +using registry_util::ScopedRegistryTempPathCleanup;
|
|
|
| class InstallerStateTest : public TestWithTempDirAndDeleteTempOverrideKeys {
|
| protected:
|
| @@ -344,7 +347,8 @@
|
| HKEY root = system_level ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
|
| EXPECT_EQ(root, installer_state.root_key());
|
| {
|
| - TempRegKeyOverride override(root, L"root_pit");
|
| + ScopedRegistryTempPathCleanup cleanup;
|
| + ScopedRegistryKeyOverride override(root, L"root_pit");
|
| BrowserDistribution* dist = BrowserDistribution::GetSpecificDistribution(
|
| BrowserDistribution::CHROME_BROWSER);
|
| RegKey chrome_key(root, dist->GetVersionKey().c_str(), KEY_ALL_ACCESS);
|
| @@ -376,7 +380,8 @@
|
|
|
| // check results for a fresh install of single Chrome
|
| {
|
| - TempRegKeyOverride override(root, L"root_inst_res");
|
| + ScopedRegistryTempPathCleanup cleanup;
|
| + ScopedRegistryKeyOverride override(root, L"root_inst_res");
|
| CommandLine cmd_line = CommandLine::FromString(L"setup.exe --system-level");
|
| const MasterPreferences prefs(cmd_line);
|
| InstallationState machine_state;
|
| @@ -403,11 +408,11 @@
|
| key.ReadValue(installer::kInstallerSuccessLaunchCmdLine, &value));
|
| EXPECT_EQ(launch_cmd, value);
|
| }
|
| - TempRegKeyOverride::DeleteAllTempKeys();
|
|
|
| // check results for a fresh install of multi Chrome
|
| {
|
| - TempRegKeyOverride override(root, L"root_inst_res");
|
| + ScopedRegistryTempPathCleanup cleanup;
|
| + ScopedRegistryKeyOverride override(root, L"root_inst_res");
|
| CommandLine cmd_line = CommandLine::FromString(
|
| L"setup.exe --system-level --multi-install --chrome");
|
| const MasterPreferences prefs(cmd_line);
|
| @@ -435,7 +440,6 @@
|
| EXPECT_EQ(launch_cmd, value);
|
| key.Close();
|
| }
|
| - TempRegKeyOverride::DeleteAllTempKeys();
|
| }
|
|
|
| // Test GetCurrentVersion when migrating single Chrome to multi
|
|
|