Chromium Code Reviews| 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 | 6 |
| 7 #include <fstream> | 7 #include <fstream> |
| 8 | 8 |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 596 } | 596 } |
| 597 } | 597 } |
| 598 | 598 |
| 599 std::set<std::string>::const_iterator iter( | 599 std::set<std::string>::const_iterator iter( |
| 600 expected_remaining_dirs.begin()); | 600 expected_remaining_dirs.begin()); |
| 601 for (; iter != expected_remaining_dirs.end(); ++iter) | 601 for (; iter != expected_remaining_dirs.end(); ++iter) |
| 602 ADD_FAILURE() << "Expected to find version dir for " << *iter; | 602 ADD_FAILURE() << "Expected to find version dir for " << *iter; |
| 603 } | 603 } |
| 604 | 604 |
| 605 TEST_F(InstallerStateTest, InitializeTwice) { | 605 TEST_F(InstallerStateTest, InitializeTwice) { |
| 606 // Force these paths to be cached so that they can be found after the | |
| 607 // registry override manager is in place. | |
| 608 { | |
| 609 base::FilePath temp; | |
| 610 PathService::Get(base::DIR_PROGRAM_FILES, &temp); | |
| 611 PathService::Get(base::DIR_PROGRAM_FILESX86, &temp); | |
|
robertshield
2014/08/29 18:49:20
Can you instead use ScopedPathOverride to explicit
grt (UTC plus 2)
2014/08/29 18:58:31
Done.
| |
| 612 } | |
| 613 registry_util::RegistryOverrideManager override_manager; | |
| 614 override_manager.OverrideRegistry(HKEY_CURRENT_USER, base::string16()); | |
| 615 override_manager.OverrideRegistry(HKEY_LOCAL_MACHINE, base::string16()); | |
| 616 | |
| 606 InstallationState machine_state; | 617 InstallationState machine_state; |
| 607 machine_state.Initialize(); | 618 machine_state.Initialize(); |
| 608 | 619 |
| 609 InstallerState installer_state; | 620 InstallerState installer_state; |
| 610 | 621 |
| 611 // Initialize the instance to install multi Chrome. | 622 // Initialize the instance to install multi Chrome. |
| 612 { | 623 { |
| 613 CommandLine cmd_line( | 624 CommandLine cmd_line( |
| 614 CommandLine::FromString(L"setup.exe --multi-install --chrome")); | 625 CommandLine::FromString(L"setup.exe --multi-install --chrome")); |
| 615 MasterPreferences prefs(cmd_line); | 626 MasterPreferences prefs(cmd_line); |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 801 // Critical update newer than the new version. | 812 // Critical update newer than the new version. |
| 802 EXPECT_FALSE( | 813 EXPECT_FALSE( |
| 803 installer_state.DetermineCriticalVersion(NULL, *pv_version_).IsValid()); | 814 installer_state.DetermineCriticalVersion(NULL, *pv_version_).IsValid()); |
| 804 EXPECT_FALSE( | 815 EXPECT_FALSE( |
| 805 installer_state.DetermineCriticalVersion(opv_version_, *pv_version_) | 816 installer_state.DetermineCriticalVersion(opv_version_, *pv_version_) |
| 806 .IsValid()); | 817 .IsValid()); |
| 807 EXPECT_FALSE( | 818 EXPECT_FALSE( |
| 808 installer_state.DetermineCriticalVersion(pv_version_, *pv_version_) | 819 installer_state.DetermineCriticalVersion(pv_version_, *pv_version_) |
| 809 .IsValid()); | 820 .IsValid()); |
| 810 } | 821 } |
| OLD | NEW |