summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoramit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-20 03:25:44 +0000
committeramit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-20 03:25:44 +0000
commita41f8d479c11aa4ed8b0460c0cb48d82b5db68f7 (patch)
treea25eddabd2136d1180e13cc3c11afb18a22ae208
parent7fea5a45e0e24f216dd24e3d90a17d0b67a99e6d (diff)
downloadchromium_src-a41f8d479c11aa4ed8b0460c0cb48d82b5db68f7.zip
chromium_src-a41f8d479c11aa4ed8b0460c0cb48d82b5db68f7.tar.gz
chromium_src-a41f8d479c11aa4ed8b0460c0cb48d82b5db68f7.tar.bz2
Fix a bug introduced by RegKey change and corresponding unit test.
BUG=70092 TEST=GoogleUpdateTest.StatsConsent Review URL: http://codereview.chromium.org/6339005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71913 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/google/google_update_settings_unittest.cc3
-rw-r--r--chrome/installer/util/google_update_settings.cc2
2 files changed, 2 insertions, 3 deletions
diff --git a/chrome/browser/google/google_update_settings_unittest.cc b/chrome/browser/google/google_update_settings_unittest.cc
index 5d837ed..13a7e33 100644
--- a/chrome/browser/google/google_update_settings_unittest.cc
+++ b/chrome/browser/google/google_update_settings_unittest.cc
@@ -9,8 +9,7 @@
class GoogleUpdateTest : public PlatformTest {
};
-// bug: http://crbug.com/70092
-TEST_F(GoogleUpdateTest, DISABLED_StatsConstent) {
+TEST_F(GoogleUpdateTest, StatsConsent) {
// Stats are off by default.
EXPECT_FALSE(GoogleUpdateSettings::GetCollectStatsConsent());
// Stats reporting is ON.
diff --git a/chrome/installer/util/google_update_settings.cc b/chrome/installer/util/google_update_settings.cc
index b93a6d6..44ee0f0 100644
--- a/chrome/installer/util/google_update_settings.cc
+++ b/chrome/installer/util/google_update_settings.cc
@@ -112,7 +112,7 @@ bool GoogleUpdateSettings::SetCollectStatsConsent(bool consented) {
key.WriteValue(google_update::kRegUsageStatsField, value);
// Writing to HKCU is used both by chrome and by the crash reporter.
reg_path = dist->GetStateKey();
- key.Open(HKEY_CURRENT_USER, reg_path.c_str(), KEY_READ | KEY_WRITE);
+ key.Create(HKEY_CURRENT_USER, reg_path.c_str(), KEY_READ | KEY_WRITE);
return (key.WriteValue(google_update::kRegUsageStatsField, value) ==
ERROR_SUCCESS);
}