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

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

Issue 7036017: Write installer results in all relevant registry keys so that we're sure that Google Update will ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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/installer/util/install_util.cc ('k') | chrome/installer/util/installer_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/install_util_unittest.cc
===================================================================
--- chrome/installer/util/install_util_unittest.cc (revision 85625)
+++ chrome/installer/util/install_util_unittest.cc (working copy)
@@ -7,19 +7,12 @@
#include "base/command_line.h"
#include "base/win/registry.h"
-#include "chrome/installer/util/browser_distribution.h"
#include "chrome/installer/util/google_update_constants.h"
-#include "chrome/installer/util/installation_state.h"
-#include "chrome/installer/util/installer_state.h"
#include "chrome/installer/util/install_util.h"
-#include "chrome/installer/util/master_preferences.h"
#include "chrome/installer/util/product_unittest.h"
#include "testing/gmock/include/gmock/gmock.h"
using base::win::RegKey;
-using installer::InstallationState;
-using installer::InstallerState;
-using installer::MasterPreferences;
using ::testing::_;
using ::testing::Return;
using ::testing::StrEq;
@@ -33,62 +26,6 @@
protected:
};
-TEST_F(InstallUtilTest, InstallerResult) {
- const bool system_level = true;
- bool multi_install = false;
- HKEY root = system_level ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
-
- RegKey key;
- std::wstring launch_cmd = L"hey diddle diddle";
- std::wstring value;
-
- // check results for a fresh install of single Chrome
- {
- TempRegKeyOverride override(root, L"root_inst_res");
- CommandLine cmd_line = CommandLine::FromString(L"setup.exe --system-level");
- const MasterPreferences prefs(cmd_line);
- InstallationState machine_state;
- machine_state.Initialize();
- InstallerState state;
- state.Initialize(cmd_line, prefs, machine_state);
- InstallUtil::WriteInstallerResult(system_level, state.state_key(),
- installer::FIRST_INSTALL_SUCCESS, 0, &launch_cmd);
- BrowserDistribution* distribution =
- BrowserDistribution::GetSpecificDistribution(
- BrowserDistribution::CHROME_BROWSER);
- 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);
- }
- TempRegKeyOverride::DeleteAllTempKeys();
-
- // check results for a fresh install of multi Chrome
- {
- TempRegKeyOverride override(root, L"root_inst_res");
- CommandLine cmd_line = 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);
- InstallUtil::WriteInstallerResult(system_level, state.state_key(),
- installer::FIRST_INSTALL_SUCCESS, 0, &launch_cmd);
- BrowserDistribution* distribution =
- BrowserDistribution::GetSpecificDistribution(
- BrowserDistribution::CHROME_BROWSER);
- 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);
- key.Close();
- }
- TempRegKeyOverride::DeleteAllTempKeys();
-}
-
TEST_F(InstallUtilTest, MakeUninstallCommand) {
CommandLine command_line(CommandLine::NO_PROGRAM);
« no previous file with comments | « chrome/installer/util/install_util.cc ('k') | chrome/installer/util/installer_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698