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 | 9 |
10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
981 | 981 |
982 #endif // defined(GOOGLE_CHROME_BUILD) | 982 #endif // defined(GOOGLE_CHROME_BUILD) |
983 | 983 |
984 // Test GoogleUpdateSettings::GetUninstallCommandLine at system- or user-level, | 984 // Test GoogleUpdateSettings::GetUninstallCommandLine at system- or user-level, |
985 // according to the param. | 985 // according to the param. |
986 class GetUninstallCommandLine : public GoogleUpdateSettingsTest, | 986 class GetUninstallCommandLine : public GoogleUpdateSettingsTest, |
987 public testing::WithParamInterface<bool> { | 987 public testing::WithParamInterface<bool> { |
988 protected: | 988 protected: |
989 static const wchar_t kDummyCommand[]; | 989 static const wchar_t kDummyCommand[]; |
990 | 990 |
991 virtual void SetUp() override { | 991 void SetUp() override { |
992 GoogleUpdateSettingsTest::SetUp(); | 992 GoogleUpdateSettingsTest::SetUp(); |
993 system_install_ = GetParam(); | 993 system_install_ = GetParam(); |
994 root_key_ = system_install_ ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; | 994 root_key_ = system_install_ ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; |
995 } | 995 } |
996 | 996 |
997 HKEY root_key_; | 997 HKEY root_key_; |
998 bool system_install_; | 998 bool system_install_; |
999 }; | 999 }; |
1000 | 1000 |
1001 const wchar_t GetUninstallCommandLine::kDummyCommand[] = | 1001 const wchar_t GetUninstallCommandLine::kDummyCommand[] = |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1040 INSTANTIATE_TEST_CASE_P(GetUninstallCommandLineAtLevel, GetUninstallCommandLine, | 1040 INSTANTIATE_TEST_CASE_P(GetUninstallCommandLineAtLevel, GetUninstallCommandLine, |
1041 testing::Bool()); | 1041 testing::Bool()); |
1042 | 1042 |
1043 // Test GoogleUpdateSettings::GetGoogleUpdateVersion at system- or user-level, | 1043 // Test GoogleUpdateSettings::GetGoogleUpdateVersion at system- or user-level, |
1044 // according to the param. | 1044 // according to the param. |
1045 class GetGoogleUpdateVersion : public GoogleUpdateSettingsTest, | 1045 class GetGoogleUpdateVersion : public GoogleUpdateSettingsTest, |
1046 public testing::WithParamInterface<bool> { | 1046 public testing::WithParamInterface<bool> { |
1047 protected: | 1047 protected: |
1048 static const wchar_t kDummyVersion[]; | 1048 static const wchar_t kDummyVersion[]; |
1049 | 1049 |
1050 virtual void SetUp() override { | 1050 void SetUp() override { |
1051 GoogleUpdateSettingsTest::SetUp(); | 1051 GoogleUpdateSettingsTest::SetUp(); |
1052 system_install_ = GetParam(); | 1052 system_install_ = GetParam(); |
1053 root_key_ = system_install_ ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; | 1053 root_key_ = system_install_ ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; |
1054 } | 1054 } |
1055 | 1055 |
1056 HKEY root_key_; | 1056 HKEY root_key_; |
1057 bool system_install_; | 1057 bool system_install_; |
1058 }; | 1058 }; |
1059 | 1059 |
1060 const wchar_t GetGoogleUpdateVersion::kDummyVersion[] = L"1.2.3.4"; | 1060 const wchar_t GetGoogleUpdateVersion::kDummyVersion[] = L"1.2.3.4"; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1158 | 1158 |
1159 const StatsState::UserLevelState StatsState::kUserLevel = {}; | 1159 const StatsState::UserLevelState StatsState::kUserLevel = {}; |
1160 const StatsState::SystemLevelState StatsState::kSystemLevel = {}; | 1160 const StatsState::SystemLevelState StatsState::kSystemLevel = {}; |
1161 | 1161 |
1162 // A value parameterized test for testing the stats collection consent setting. | 1162 // A value parameterized test for testing the stats collection consent setting. |
1163 class CollectStatsConsent : public ::testing::TestWithParam<StatsState> { | 1163 class CollectStatsConsent : public ::testing::TestWithParam<StatsState> { |
1164 public: | 1164 public: |
1165 static void SetUpTestCase(); | 1165 static void SetUpTestCase(); |
1166 static void TearDownTestCase(); | 1166 static void TearDownTestCase(); |
1167 protected: | 1167 protected: |
1168 virtual void SetUp() override; | 1168 void SetUp() override; |
1169 static void MakeChromeMultiInstall(HKEY root_key); | 1169 static void MakeChromeMultiInstall(HKEY root_key); |
1170 static void ApplySetting(StatsState::StateSetting setting, | 1170 static void ApplySetting(StatsState::StateSetting setting, |
1171 HKEY root_key, | 1171 HKEY root_key, |
1172 const base::string16& reg_key); | 1172 const base::string16& reg_key); |
1173 | 1173 |
1174 static base::string16* chrome_version_key_; | 1174 static base::string16* chrome_version_key_; |
1175 static base::string16* chrome_state_key_; | 1175 static base::string16* chrome_state_key_; |
1176 static base::string16* chrome_state_medium_key_; | 1176 static base::string16* chrome_state_medium_key_; |
1177 static base::string16* binaries_state_key_; | 1177 static base::string16* binaries_state_key_; |
1178 static base::string16* binaries_state_medium_key_; | 1178 static base::string16* binaries_state_medium_key_; |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1357 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, | 1357 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, |
1358 StatsState::FALSE_SETTING, StatsState::FALSE_SETTING), | 1358 StatsState::FALSE_SETTING, StatsState::FALSE_SETTING), |
1359 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, | 1359 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, |
1360 StatsState::FALSE_SETTING, StatsState::TRUE_SETTING), | 1360 StatsState::FALSE_SETTING, StatsState::TRUE_SETTING), |
1361 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, | 1361 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, |
1362 StatsState::TRUE_SETTING, StatsState::NO_SETTING), | 1362 StatsState::TRUE_SETTING, StatsState::NO_SETTING), |
1363 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, | 1363 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, |
1364 StatsState::TRUE_SETTING, StatsState::FALSE_SETTING), | 1364 StatsState::TRUE_SETTING, StatsState::FALSE_SETTING), |
1365 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, | 1365 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, |
1366 StatsState::TRUE_SETTING, StatsState::TRUE_SETTING))); | 1366 StatsState::TRUE_SETTING, StatsState::TRUE_SETTING))); |
OLD | NEW |