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_frame/test/chrome_frame_test_utils.h" | 5 #include "chrome_frame/test/chrome_frame_test_utils.h" |
6 | 6 |
7 #include <atlapp.h> | 7 #include <atlapp.h> |
8 #include <atlmisc.h> | 8 #include <atlmisc.h> |
9 #include <iepmapi.h> | 9 #include <iepmapi.h> |
10 #include <sddl.h> | 10 #include <sddl.h> |
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 } | 672 } |
673 | 673 |
674 ScopedVirtualizeHklmAndHkcu::ScopedVirtualizeHklmAndHkcu() { | 674 ScopedVirtualizeHklmAndHkcu::ScopedVirtualizeHklmAndHkcu() { |
675 override_manager_.OverrideRegistry(HKEY_LOCAL_MACHINE, L"hklm_fake"); | 675 override_manager_.OverrideRegistry(HKEY_LOCAL_MACHINE, L"hklm_fake"); |
676 override_manager_.OverrideRegistry(HKEY_CURRENT_USER, L"hkcu_fake"); | 676 override_manager_.OverrideRegistry(HKEY_CURRENT_USER, L"hkcu_fake"); |
677 } | 677 } |
678 | 678 |
679 ScopedVirtualizeHklmAndHkcu::~ScopedVirtualizeHklmAndHkcu() { | 679 ScopedVirtualizeHklmAndHkcu::~ScopedVirtualizeHklmAndHkcu() { |
680 } | 680 } |
681 | 681 |
| 682 void ScopedVirtualizeHklmAndHkcu::RemoveAllOverrides() { |
| 683 override_manager_.RemoveAllOverrides(); |
| 684 } |
| 685 |
682 bool KillProcesses(const std::wstring& executable_name, int exit_code, | 686 bool KillProcesses(const std::wstring& executable_name, int exit_code, |
683 bool wait) { | 687 bool wait) { |
684 bool result = true; | 688 bool result = true; |
685 base::NamedProcessIterator iter(executable_name, NULL); | 689 base::NamedProcessIterator iter(executable_name, NULL); |
686 while (const base::ProcessEntry* entry = iter.NextProcessEntry()) { | 690 while (const base::ProcessEntry* entry = iter.NextProcessEntry()) { |
687 result &= base::KillProcessById(entry->pid(), exit_code, wait); | 691 result &= base::KillProcessById(entry->pid(), exit_code, wait); |
688 } | 692 } |
689 return result; | 693 return result; |
690 } | 694 } |
691 | 695 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
736 if (address.empty()) { | 740 if (address.empty()) { |
737 LOG(ERROR) << "Failed to find a non-loopback IP_V4 address. Tests will be " | 741 LOG(ERROR) << "Failed to find a non-loopback IP_V4 address. Tests will be " |
738 << "run over the loopback adapter, which may result in hangs."; | 742 << "run over the loopback adapter, which may result in hangs."; |
739 address.assign("127.0.0.1"); | 743 address.assign("127.0.0.1"); |
740 } | 744 } |
741 | 745 |
742 return address; | 746 return address; |
743 } | 747 } |
744 | 748 |
745 } // namespace chrome_frame_test | 749 } // namespace chrome_frame_test |
OLD | NEW |