summaryrefslogtreecommitdiffstats
path: root/chrome/installer
diff options
context:
space:
mode:
authorgrt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-22 11:58:49 +0000
committergrt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-22 11:58:49 +0000
commit10a1d30646c2b475fa308b8d5f0e496d6b1283cf (patch)
treea10102ddf4639cb7b9cc0b7d84101b681c98d792 /chrome/installer
parentf27bbe00ec90a4be512033f500ec933508ea3532 (diff)
downloadchromium_src-10a1d30646c2b475fa308b8d5f0e496d6b1283cf.zip
chromium_src-10a1d30646c2b475fa308b8d5f0e496d6b1283cf.tar.gz
chromium_src-10a1d30646c2b475fa308b8d5f0e496d6b1283cf.tar.bz2
Overwrite the multi-install binaries' usagestates value if it's already there.
Previously, AddUsageStatsWorkItems was conservative and wouldn't overwrite an existing usagestats value. As it happens, this breaks overinstalls. Now it clobbers the old value with any new value written to a product's ClientState key by Omaha. BUG=108231 TEST=overinstall Chrome with a different state consent setting than is in use; see the bug for detailed scenarios. R=erikwright@chromium.org Review URL: http://codereview.chromium.org/9019025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115517 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer')
-rw-r--r--chrome/installer/setup/install_worker.cc4
-rw-r--r--chrome/installer/setup/install_worker_unittest.cc5
2 files changed, 6 insertions, 3 deletions
diff --git a/chrome/installer/setup/install_worker.cc b/chrome/installer/setup/install_worker.cc
index 7105590..73fb098 100644
--- a/chrome/installer/setup/install_worker.cc
+++ b/chrome/installer/setup/install_worker.cc
@@ -469,9 +469,11 @@ void AddUsageStatsWorkItems(const InstallationState& original_state,
std::wstring state_key(
installer_state.multi_package_binaries_distribution()->GetStateKey());
install_list->AddCreateRegKeyWorkItem(root_key, state_key);
+ // Overwrite any existing value so that overinstalls (where Omaha writes a
+ // new value into a product's state key) pick up the correct value.
install_list->AddSetRegValueWorkItem(root_key, state_key,
google_update::kRegUsageStatsField,
- usagestats, false);
+ usagestats, true);
for (Products::const_iterator scan = products.begin(), end = products.end();
scan != end; ++scan) {
diff --git a/chrome/installer/setup/install_worker_unittest.cc b/chrome/installer/setup/install_worker_unittest.cc
index e5936df..a683b0c 100644
--- a/chrome/installer/setup/install_worker_unittest.cc
+++ b/chrome/installer/setup/install_worker_unittest.cc
@@ -598,7 +598,7 @@ TEST_F(InstallWorkerTest, AddUsageStatsWorkItems) {
HasSubstr(multi_app_guid),
StrEq(google_update::kRegUsageStatsField),
Eq(static_cast<DWORD>(1)),
- _)).Times(1);
+ Eq(true))).Times(1);
// Expect to see some values cleaned up from Chrome's keys.
BrowserDistribution* chrome_dist =
@@ -624,7 +624,8 @@ TEST_F(InstallWorkerTest, AddUsageStatsWorkItems) {
AddUsageStatsWorkItems(*installation_state.get(),
*installer_state.get(),
- &work_item_list);}
+ &work_item_list);
+}
// The Quick Enable tests only make sense for the Google Chrome build as it
// interacts with registry values that are specific to Google Update.