Chromium Code Reviews| Index: chrome/installer/setup/installer_state_unittest.cc |
| diff --git a/chrome/installer/setup/installer_state_unittest.cc b/chrome/installer/setup/installer_state_unittest.cc |
| index c34c3a09f793c5da60d6fc05f64a03dfd0d98c65..a750568aab4fd9e21e38782bee2f0a459051e109 100644 |
| --- a/chrome/installer/setup/installer_state_unittest.cc |
| +++ b/chrome/installer/setup/installer_state_unittest.cc |
| @@ -123,12 +123,16 @@ TEST_F(InstallerStateTest, InstallerResult) { |
| std::wstring value; |
| DWORD dw_value; |
| - // check results for a fresh install of single Chrome |
| - { |
| + // check results for a fresh install of single Chrome and the same for an |
|
gab
2016/12/12 21:38:16
s/check/Check
grt (UTC plus 2)
2016/12/13 09:20:37
Done.
|
| + // attempt at multi-install, which is now ignored. |
| + static constexpr const wchar_t* kCommandLines[] = { |
|
gab
2016/12/12 21:38:16
const wchar_t* const
grt (UTC plus 2)
2016/12/13 09:20:37
not needed. "constexpr const wchar_t*" reads like
|
| + L"setup.exe --system-level", |
| + L"setup.exe --system-level --multi-install --chrome", |
| + }; |
| + for (const wchar_t* command_line : kCommandLines) { |
| RegistryOverrideManager override_manager; |
| override_manager.OverrideRegistry(root); |
| - base::CommandLine cmd_line = |
| - base::CommandLine::FromString(L"setup.exe --system-level"); |
| + base::CommandLine cmd_line = base::CommandLine::FromString(command_line); |
| const MasterPreferences prefs(cmd_line); |
| InstallationState machine_state; |
| machine_state.Initialize(); |
| @@ -154,38 +158,6 @@ TEST_F(InstallerStateTest, InstallerResult) { |
| key.ReadValue(installer::kInstallerSuccessLaunchCmdLine, &value)); |
| EXPECT_EQ(launch_cmd, value); |
| } |
| - |
| - // check results for a fresh install of multi Chrome |
| - { |
| - RegistryOverrideManager override_manager; |
| - override_manager.OverrideRegistry(root); |
| - base::CommandLine cmd_line = base::CommandLine::FromString( |
| - L"setup.exe --system-level --multi-install --chrome"); |
| - const MasterPreferences prefs(cmd_line); |
| - InstallationState machine_state; |
| - machine_state.Initialize(); |
| - InstallerState state; |
| - state.Initialize(cmd_line, prefs, machine_state); |
| - state.WriteInstallerResult(installer::FIRST_INSTALL_SUCCESS, 0, |
| - &launch_cmd); |
| - BrowserDistribution* distribution = |
| - BrowserDistribution::GetSpecificDistribution( |
| - BrowserDistribution::CHROME_BROWSER); |
| - BrowserDistribution* binaries = |
| - BrowserDistribution::GetSpecificDistribution( |
| - BrowserDistribution::CHROME_BINARIES); |
| - EXPECT_EQ(ERROR_SUCCESS, |
| - key.Open(root, distribution->GetStateKey().c_str(), KEY_READ)); |
| - EXPECT_EQ(ERROR_SUCCESS, |
| - key.ReadValue(installer::kInstallerSuccessLaunchCmdLine, &value)); |
| - EXPECT_EQ(launch_cmd, value); |
| - EXPECT_EQ(ERROR_SUCCESS, |
| - key.Open(root, binaries->GetStateKey().c_str(), KEY_READ)); |
| - EXPECT_EQ(ERROR_SUCCESS, |
| - key.ReadValue(installer::kInstallerSuccessLaunchCmdLine, &value)); |
| - EXPECT_EQ(launch_cmd, value); |
| - key.Close(); |
| - } |
| } |
| // Test GetCurrentVersion when migrating single Chrome to multi |
| @@ -259,27 +231,27 @@ TEST_F(InstallerStateTest, InitializeTwice) { |
| InstallerState installer_state; |
| - // Initialize the instance to install multi Chrome. |
| + // Initialize the instance to install user-level Chrome. |
| { |
| - base::CommandLine cmd_line( |
| - base::CommandLine::FromString(L"setup.exe --multi-install --chrome")); |
| + base::CommandLine cmd_line(base::CommandLine::FromString(L"setup.exe")); |
| MasterPreferences prefs(cmd_line); |
| installer_state.Initialize(cmd_line, prefs, machine_state); |
| } |
| // Confirm the expected state. |
| EXPECT_EQ(InstallerState::USER_LEVEL, installer_state.level()); |
| - EXPECT_EQ(InstallerState::MULTI_PACKAGE, installer_state.package_type()); |
| - EXPECT_EQ(InstallerState::MULTI_INSTALL, installer_state.operation()); |
| + EXPECT_EQ(InstallerState::SINGLE_PACKAGE, installer_state.package_type()); |
| + EXPECT_EQ(InstallerState::SINGLE_INSTALL_OR_UPDATE, |
|
gab
2016/12/12 21:38:16
Assuming we will get rid of the "Single" terminolo
grt (UTC plus 2)
2016/12/13 09:20:37
Yes, all cleanups will be in separate CLs.
|
| + installer_state.operation()); |
| EXPECT_TRUE(wcsstr(installer_state.target_path().value().c_str(), |
| BrowserDistribution::GetSpecificDistribution( |
| - BrowserDistribution::CHROME_BINARIES)-> |
| - GetInstallSubDir().c_str())); |
| + BrowserDistribution::CHROME_BROWSER) |
| + ->GetInstallSubDir() |
| + .c_str())); |
| EXPECT_FALSE(installer_state.verbose_logging()); |
| EXPECT_EQ(installer_state.state_key(), |
| BrowserDistribution::GetSpecificDistribution( |
| BrowserDistribution::CHROME_BROWSER)->GetStateKey()); |
| EXPECT_EQ(installer_state.state_type(), BrowserDistribution::CHROME_BROWSER); |
| - EXPECT_TRUE(installer_state.multi_package_binaries_distribution()); |
| EXPECT_TRUE(installer_state.FindProduct(BrowserDistribution::CHROME_BROWSER)); |
| // Now initialize it to install system-level single Chrome. |