| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/installer/util/google_update_settings.h" | 5 #include "chrome/installer/util/google_update_settings.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <shlwapi.h> // For SHDeleteKey. | 8 #include <shlwapi.h> // For SHDeleteKey. |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 << "\" for ap=\"" << ap << "\""; | 120 << "\" for ap=\"" << ap << "\""; |
| 121 } | 121 } |
| 122 } | 122 } |
| 123 } | 123 } |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 | 126 |
| 127 // Test the writing and deleting functionality of the experiments label | 127 // Test the writing and deleting functionality of the experiments label |
| 128 // helper. | 128 // helper. |
| 129 void TestExperimentsLabelHelper(SystemUserInstall install) { | 129 void TestExperimentsLabelHelper(SystemUserInstall install) { |
| 130 BrowserDistribution* chrome = | 130 BrowserDistribution* chrome = BrowserDistribution::GetDistribution(); |
| 131 BrowserDistribution::GetSpecificDistribution( | |
| 132 BrowserDistribution::CHROME_BROWSER); | |
| 133 base::string16 value; | 131 base::string16 value; |
| 134 #if defined(GOOGLE_CHROME_BUILD) | 132 #if defined(GOOGLE_CHROME_BUILD) |
| 135 EXPECT_TRUE(chrome->ShouldSetExperimentLabels()); | 133 EXPECT_TRUE(chrome->ShouldSetExperimentLabels()); |
| 136 | 134 |
| 137 // Before anything is set, ReadExperimentLabels should succeed but return | 135 // Before anything is set, ReadExperimentLabels should succeed but return |
| 138 // an empty string. | 136 // an empty string. |
| 139 EXPECT_TRUE(GoogleUpdateSettings::ReadExperimentLabels( | 137 EXPECT_TRUE(GoogleUpdateSettings::ReadExperimentLabels( |
| 140 install == SYSTEM_INSTALL, &value)); | 138 install == SYSTEM_INSTALL, &value)); |
| 141 EXPECT_EQ(base::string16(), value); | 139 EXPECT_EQ(base::string16(), value); |
| 142 | 140 |
| (...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1183 static base::string16* chrome_state_key_; | 1181 static base::string16* chrome_state_key_; |
| 1184 static base::string16* chrome_state_medium_key_; | 1182 static base::string16* chrome_state_medium_key_; |
| 1185 registry_util::RegistryOverrideManager override_manager_; | 1183 registry_util::RegistryOverrideManager override_manager_; |
| 1186 }; | 1184 }; |
| 1187 | 1185 |
| 1188 base::string16* CollectStatsConsent::chrome_version_key_; | 1186 base::string16* CollectStatsConsent::chrome_version_key_; |
| 1189 base::string16* CollectStatsConsent::chrome_state_key_; | 1187 base::string16* CollectStatsConsent::chrome_state_key_; |
| 1190 base::string16* CollectStatsConsent::chrome_state_medium_key_; | 1188 base::string16* CollectStatsConsent::chrome_state_medium_key_; |
| 1191 | 1189 |
| 1192 void CollectStatsConsent::SetUpTestCase() { | 1190 void CollectStatsConsent::SetUpTestCase() { |
| 1193 BrowserDistribution* dist = | 1191 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
| 1194 BrowserDistribution::GetSpecificDistribution( | |
| 1195 BrowserDistribution::CHROME_BROWSER); | |
| 1196 chrome_version_key_ = new base::string16(dist->GetVersionKey()); | 1192 chrome_version_key_ = new base::string16(dist->GetVersionKey()); |
| 1197 chrome_state_key_ = new base::string16(dist->GetStateKey()); | 1193 chrome_state_key_ = new base::string16(dist->GetStateKey()); |
| 1198 chrome_state_medium_key_ = new base::string16(dist->GetStateMediumKey()); | 1194 chrome_state_medium_key_ = new base::string16(dist->GetStateMediumKey()); |
| 1199 } | 1195 } |
| 1200 | 1196 |
| 1201 void CollectStatsConsent::TearDownTestCase() { | 1197 void CollectStatsConsent::TearDownTestCase() { |
| 1202 delete chrome_version_key_; | 1198 delete chrome_version_key_; |
| 1203 delete chrome_state_key_; | 1199 delete chrome_state_key_; |
| 1204 delete chrome_state_medium_key_; | 1200 delete chrome_state_medium_key_; |
| 1205 } | 1201 } |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1311 StatsState::TRUE_SETTING), | 1307 StatsState::TRUE_SETTING), |
| 1312 StatsState(StatsState::kSystemLevel, | 1308 StatsState(StatsState::kSystemLevel, |
| 1313 StatsState::TRUE_SETTING, | 1309 StatsState::TRUE_SETTING, |
| 1314 StatsState::NO_SETTING), | 1310 StatsState::NO_SETTING), |
| 1315 StatsState(StatsState::kSystemLevel, | 1311 StatsState(StatsState::kSystemLevel, |
| 1316 StatsState::TRUE_SETTING, | 1312 StatsState::TRUE_SETTING, |
| 1317 StatsState::FALSE_SETTING), | 1313 StatsState::FALSE_SETTING), |
| 1318 StatsState(StatsState::kSystemLevel, | 1314 StatsState(StatsState::kSystemLevel, |
| 1319 StatsState::TRUE_SETTING, | 1315 StatsState::TRUE_SETTING, |
| 1320 StatsState::TRUE_SETTING))); | 1316 StatsState::TRUE_SETTING))); |
| OLD | NEW |