| 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 <windows.h> | 5 #include <windows.h> |
| 6 #include <shlwapi.h> // For SHDeleteKey. | 6 #include <shlwapi.h> // For SHDeleteKey. |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/test/test_reg_util_win.h" | 10 #include "base/test/test_reg_util_win.h" |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 | 448 |
| 449 TEST_F(GoogleUpdateSettingsTest, SetEULAConsent) { | 449 TEST_F(GoogleUpdateSettingsTest, SetEULAConsent) { |
| 450 using installer::FakeInstallationState; | 450 using installer::FakeInstallationState; |
| 451 | 451 |
| 452 const bool multi_install = true; | 452 const bool multi_install = true; |
| 453 const bool system_level = true; | 453 const bool system_level = true; |
| 454 FakeInstallationState machine_state; | 454 FakeInstallationState machine_state; |
| 455 | 455 |
| 456 // Chrome is installed. | 456 // Chrome is installed. |
| 457 machine_state.AddChrome(system_level, multi_install, | 457 machine_state.AddChrome(system_level, multi_install, |
| 458 new Version(chrome::kChromeVersion)); | 458 new base::Version(chrome::kChromeVersion)); |
| 459 | 459 |
| 460 RegKey key; | 460 RegKey key; |
| 461 DWORD value; | 461 DWORD value; |
| 462 BrowserDistribution* binaries = | 462 BrowserDistribution* binaries = |
| 463 BrowserDistribution::GetSpecificDistribution( | 463 BrowserDistribution::GetSpecificDistribution( |
| 464 BrowserDistribution::CHROME_BINARIES); | 464 BrowserDistribution::CHROME_BINARIES); |
| 465 BrowserDistribution* chrome = | 465 BrowserDistribution* chrome = |
| 466 BrowserDistribution::GetSpecificDistribution( | 466 BrowserDistribution::GetSpecificDistribution( |
| 467 BrowserDistribution::CHROME_BROWSER); | 467 BrowserDistribution::CHROME_BROWSER); |
| 468 | 468 |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 .WriteValue(google_update::kRegGoogleUpdateVersion, L""); | 742 .WriteValue(google_update::kRegGoogleUpdateVersion, L""); |
| 743 EXPECT_FALSE( | 743 EXPECT_FALSE( |
| 744 GoogleUpdateSettings::GetGoogleUpdateVersion(system_install_).IsValid()); | 744 GoogleUpdateSettings::GetGoogleUpdateVersion(system_install_).IsValid()); |
| 745 } | 745 } |
| 746 | 746 |
| 747 // Tests that GetGoogleUpdateVersion returns the correct string if there's a | 747 // Tests that GetGoogleUpdateVersion returns the correct string if there's a |
| 748 // version value in the Software\Google\Update key. | 748 // version value in the Software\Google\Update key. |
| 749 TEST_P(GetGoogleUpdateVersion, TestRealValue) { | 749 TEST_P(GetGoogleUpdateVersion, TestRealValue) { |
| 750 RegKey(root_key_, google_update::kRegPathGoogleUpdate, KEY_SET_VALUE) | 750 RegKey(root_key_, google_update::kRegPathGoogleUpdate, KEY_SET_VALUE) |
| 751 .WriteValue(google_update::kRegGoogleUpdateVersion, kDummyVersion); | 751 .WriteValue(google_update::kRegGoogleUpdateVersion, kDummyVersion); |
| 752 Version expected(UTF16ToUTF8(kDummyVersion)); | 752 base::Version expected(UTF16ToUTF8(kDummyVersion)); |
| 753 EXPECT_TRUE(expected.Equals( | 753 EXPECT_TRUE(expected.Equals( |
| 754 GoogleUpdateSettings::GetGoogleUpdateVersion(system_install_))); | 754 GoogleUpdateSettings::GetGoogleUpdateVersion(system_install_))); |
| 755 // Make sure that there's no value in the other level (user or system). | 755 // Make sure that there's no value in the other level (user or system). |
| 756 EXPECT_FALSE( | 756 EXPECT_FALSE( |
| 757 GoogleUpdateSettings::GetGoogleUpdateVersion(!system_install_) | 757 GoogleUpdateSettings::GetGoogleUpdateVersion(!system_install_) |
| 758 .IsValid()); | 758 .IsValid()); |
| 759 } | 759 } |
| 760 | 760 |
| 761 INSTANTIATE_TEST_CASE_P(GetGoogleUpdateVersionAtLevel, GetGoogleUpdateVersion, | 761 INSTANTIATE_TEST_CASE_P(GetGoogleUpdateVersionAtLevel, GetGoogleUpdateVersion, |
| 762 testing::Bool()); | 762 testing::Bool()); |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, | 1016 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, |
| 1017 StatsState::FALSE_SETTING, StatsState::FALSE_SETTING), | 1017 StatsState::FALSE_SETTING, StatsState::FALSE_SETTING), |
| 1018 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, | 1018 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, |
| 1019 StatsState::FALSE_SETTING, StatsState::TRUE_SETTING), | 1019 StatsState::FALSE_SETTING, StatsState::TRUE_SETTING), |
| 1020 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, | 1020 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, |
| 1021 StatsState::TRUE_SETTING, StatsState::NO_SETTING), | 1021 StatsState::TRUE_SETTING, StatsState::NO_SETTING), |
| 1022 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, | 1022 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, |
| 1023 StatsState::TRUE_SETTING, StatsState::FALSE_SETTING), | 1023 StatsState::TRUE_SETTING, StatsState::FALSE_SETTING), |
| 1024 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, | 1024 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, |
| 1025 StatsState::TRUE_SETTING, StatsState::TRUE_SETTING))); | 1025 StatsState::TRUE_SETTING, StatsState::TRUE_SETTING))); |
| OLD | NEW |