Commit f4a0debc authored by Yusuf Sengul's avatar Yusuf Sengul Committed by Commit Bot

Fix retrieving regisry value for standalone installatioon

Bug: 1137515
Change-Id: I726a1cc7d4f8aa39c68c9c12b92ba40ba4140b17
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2466009
Commit-Queue: Yusuf Sengul <yusufsn@google.com>
Reviewed-by: default avatarRakesh Soma <rakeshsoma@google.com>
Cr-Commit-Position: refs/heads/master@{#816350}
parent 16b4bce5
...@@ -13,7 +13,7 @@ const wchar_t kGCPWExtensionServiceDisplayName[] = L"GCPW Extension Service"; ...@@ -13,7 +13,7 @@ const wchar_t kGCPWExtensionServiceDisplayName[] = L"GCPW Extension Service";
const wchar_t kEnableGCPWExtension[] = L"enable_gcpw_extension"; const wchar_t kEnableGCPWExtension[] = L"enable_gcpw_extension";
const wchar_t kLastPeriodicSyncTimeRegKey[] = L"last_periodic_sync"; const wchar_t kLastPeriodicSyncTimeRegKey[] = L"extension_last_periodic_sync";
} // namespace extension } // namespace extension
} // namespace credential_provider } // namespace credential_provider
...@@ -63,7 +63,7 @@ void StandaloneInstallerConfigurator::ConfigureInstallationType( ...@@ -63,7 +63,7 @@ void StandaloneInstallerConfigurator::ConfigureInstallationType(
HRESULT hr = SetUpdaterClientsAppPathFlag(standalone_install16, 1); HRESULT hr = SetUpdaterClientsAppPathFlag(standalone_install16, 1);
if (FAILED(hr)) if (FAILED(hr))
LOGFN(ERROR) << "SetGlobalFlag failed" << putHR(hr); LOGFN(ERROR) << "SetGlobalFlag failed" << putHR(hr);
} else if (GetUpdaterClientsAppPathFlag(standalone_install16, 0)) { } else if (GetUpdaterClientsAppPathFlagOrDefault(standalone_install16, 0)) {
is_standalone_installation_ = true; is_standalone_installation_ = true;
} }
} }
......
...@@ -406,9 +406,31 @@ TEST_F(GcpSetupTest, DoInstallWithExtension) { ...@@ -406,9 +406,31 @@ TEST_F(GcpSetupTest, DoInstallWithExtension) {
fake_scoped_lsa_policy_factory()->private_data()[kLsaKeyGaiaUsername]); fake_scoped_lsa_policy_factory()->private_data()[kLsaKeyGaiaUsername]);
} }
TEST_F(GcpSetupTest, DoInstallOverOldInstall) { // Tests install over old install for different types of installations.
// 0 - Indicates that initial installation isn't standalone.
// 1 - Indicates that the initial installation is through a standalone
// installer.
class GcpInstallOverOldInstallTest : public GcpSetupTest,
public ::testing::WithParamInterface<int> {
public:
void SetInstallerConfig(bool append_standalone_flag) {
if (append_standalone_flag) {
base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
command_line.AppendSwitch(switches::kStandaloneInstall);
StandaloneInstallerConfigurator::Get()->ConfigureInstallationType(
command_line);
}
}
};
TEST_P(GcpInstallOverOldInstallTest, DoInstallOverOldInstall) {
logging::ResetEventSourceForTesting(); logging::ResetEventSourceForTesting();
// Set installer config as if --standalone flag was provided as indicated by
// test parameter.
SetInstallerConfig(GetParam());
// Install using some old version. // Install using some old version.
const base::string16 old_version(L"1.0.0.0"); const base::string16 old_version(L"1.0.0.0");
ASSERT_EQ(S_OK, DoInstall(module_path(), old_version, fakes_for_testing())); ASSERT_EQ(S_OK, DoInstall(module_path(), old_version, fakes_for_testing()));
...@@ -427,6 +449,13 @@ TEST_F(GcpSetupTest, DoInstallOverOldInstall) { ...@@ -427,6 +449,13 @@ TEST_F(GcpSetupTest, DoInstallOverOldInstall) {
logging::ResetEventSourceForTesting(); logging::ResetEventSourceForTesting();
// Don't include standalone flag as it should have already been indicated in
// the registry the first time this is called.
SetInstallerConfig(false);
EXPECT_TRUE(
StandaloneInstallerConfigurator::Get()->IsStandaloneInstallation() ==
GetParam());
// Now install a newer version. // Now install a newer version.
ASSERT_EQ(S_OK, ASSERT_EQ(S_OK,
DoInstall(module_path(), product_version(), fakes_for_testing())); DoInstall(module_path(), product_version(), fakes_for_testing()));
...@@ -447,6 +476,10 @@ TEST_F(GcpSetupTest, DoInstallOverOldInstall) { ...@@ -447,6 +476,10 @@ TEST_F(GcpSetupTest, DoInstallOverOldInstall) {
fake_scoped_lsa_policy_factory()->private_data()[kLsaKeyGaiaUsername]); fake_scoped_lsa_policy_factory()->private_data()[kLsaKeyGaiaUsername]);
} }
INSTANTIATE_TEST_SUITE_P(All,
GcpInstallOverOldInstallTest,
::testing::Values(0, 1));
TEST_F(GcpSetupTest, DoInstallOverOldLockedInstall) { TEST_F(GcpSetupTest, DoInstallOverOldLockedInstall) {
logging::ResetEventSourceForTesting(); logging::ResetEventSourceForTesting();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment