| 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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 | 576 |
| 577 TEST_F(GoogleUpdateSettingsTest, SetEULAConsent) { | 577 TEST_F(GoogleUpdateSettingsTest, SetEULAConsent) { |
| 578 using installer::FakeInstallationState; | 578 using installer::FakeInstallationState; |
| 579 | 579 |
| 580 const bool multi_install = true; | 580 const bool multi_install = true; |
| 581 const bool system_level = true; | 581 const bool system_level = true; |
| 582 FakeInstallationState machine_state; | 582 FakeInstallationState machine_state; |
| 583 | 583 |
| 584 // Chrome is installed. | 584 // Chrome is installed. |
| 585 machine_state.AddChrome(system_level, multi_install, | 585 machine_state.AddChrome(system_level, multi_install, |
| 586 new base::Version(chrome::kChromeVersion)); | 586 new Version(chrome::kChromeVersion)); |
| 587 | 587 |
| 588 RegKey key; | 588 RegKey key; |
| 589 DWORD value; | 589 DWORD value; |
| 590 BrowserDistribution* binaries = | 590 BrowserDistribution* binaries = |
| 591 BrowserDistribution::GetSpecificDistribution( | 591 BrowserDistribution::GetSpecificDistribution( |
| 592 BrowserDistribution::CHROME_BINARIES); | 592 BrowserDistribution::CHROME_BINARIES); |
| 593 BrowserDistribution* chrome = | 593 BrowserDistribution* chrome = |
| 594 BrowserDistribution::GetSpecificDistribution( | 594 BrowserDistribution::GetSpecificDistribution( |
| 595 BrowserDistribution::CHROME_BROWSER); | 595 BrowserDistribution::CHROME_BROWSER); |
| 596 | 596 |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1083 .WriteValue(google_update::kRegGoogleUpdateVersion, L""); | 1083 .WriteValue(google_update::kRegGoogleUpdateVersion, L""); |
| 1084 EXPECT_FALSE( | 1084 EXPECT_FALSE( |
| 1085 GoogleUpdateSettings::GetGoogleUpdateVersion(system_install_).IsValid()); | 1085 GoogleUpdateSettings::GetGoogleUpdateVersion(system_install_).IsValid()); |
| 1086 } | 1086 } |
| 1087 | 1087 |
| 1088 // Tests that GetGoogleUpdateVersion returns the correct string if there's a | 1088 // Tests that GetGoogleUpdateVersion returns the correct string if there's a |
| 1089 // version value in the Software\Google\Update key. | 1089 // version value in the Software\Google\Update key. |
| 1090 TEST_P(GetGoogleUpdateVersion, TestRealValue) { | 1090 TEST_P(GetGoogleUpdateVersion, TestRealValue) { |
| 1091 RegKey(root_key_, google_update::kRegPathGoogleUpdate, KEY_SET_VALUE) | 1091 RegKey(root_key_, google_update::kRegPathGoogleUpdate, KEY_SET_VALUE) |
| 1092 .WriteValue(google_update::kRegGoogleUpdateVersion, kDummyVersion); | 1092 .WriteValue(google_update::kRegGoogleUpdateVersion, kDummyVersion); |
| 1093 base::Version expected(base::UTF16ToUTF8(kDummyVersion)); | 1093 Version expected(base::UTF16ToUTF8(kDummyVersion)); |
| 1094 EXPECT_TRUE(expected.Equals( | 1094 EXPECT_TRUE(expected.Equals( |
| 1095 GoogleUpdateSettings::GetGoogleUpdateVersion(system_install_))); | 1095 GoogleUpdateSettings::GetGoogleUpdateVersion(system_install_))); |
| 1096 // Make sure that there's no value in the other level (user or system). | 1096 // Make sure that there's no value in the other level (user or system). |
| 1097 EXPECT_FALSE( | 1097 EXPECT_FALSE( |
| 1098 GoogleUpdateSettings::GetGoogleUpdateVersion(!system_install_) | 1098 GoogleUpdateSettings::GetGoogleUpdateVersion(!system_install_) |
| 1099 .IsValid()); | 1099 .IsValid()); |
| 1100 } | 1100 } |
| 1101 | 1101 |
| 1102 INSTANTIATE_TEST_CASE_P(GetGoogleUpdateVersionAtLevel, GetGoogleUpdateVersion, | 1102 INSTANTIATE_TEST_CASE_P(GetGoogleUpdateVersionAtLevel, GetGoogleUpdateVersion, |
| 1103 testing::Bool()); | 1103 testing::Bool()); |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1359 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, | 1359 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, |
| 1360 StatsState::FALSE_SETTING, StatsState::FALSE_SETTING), | 1360 StatsState::FALSE_SETTING, StatsState::FALSE_SETTING), |
| 1361 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, | 1361 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, |
| 1362 StatsState::FALSE_SETTING, StatsState::TRUE_SETTING), | 1362 StatsState::FALSE_SETTING, StatsState::TRUE_SETTING), |
| 1363 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, | 1363 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, |
| 1364 StatsState::TRUE_SETTING, StatsState::NO_SETTING), | 1364 StatsState::TRUE_SETTING, StatsState::NO_SETTING), |
| 1365 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, | 1365 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, |
| 1366 StatsState::TRUE_SETTING, StatsState::FALSE_SETTING), | 1366 StatsState::TRUE_SETTING, StatsState::FALSE_SETTING), |
| 1367 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, | 1367 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, |
| 1368 StatsState::TRUE_SETTING, StatsState::TRUE_SETTING))); | 1368 StatsState::TRUE_SETTING, StatsState::TRUE_SETTING))); |
| OLD | NEW |