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 | |
686 bool KillProcesses(const std::wstring& executable_name, int exit_code, | 682 bool KillProcesses(const std::wstring& executable_name, int exit_code, |
687 bool wait) { | 683 bool wait) { |
688 bool result = true; | 684 bool result = true; |
689 base::NamedProcessIterator iter(executable_name, NULL); | 685 base::NamedProcessIterator iter(executable_name, NULL); |
690 while (const base::ProcessEntry* entry = iter.NextProcessEntry()) { | 686 while (const base::ProcessEntry* entry = iter.NextProcessEntry()) { |
691 result &= base::KillProcessById(entry->pid(), exit_code, wait); | 687 result &= base::KillProcessById(entry->pid(), exit_code, wait); |
692 } | 688 } |
693 return result; | 689 return result; |
694 } | 690 } |
695 | 691 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 if (address.empty()) { | 736 if (address.empty()) { |
741 LOG(ERROR) << "Failed to find a non-loopback IP_V4 address. Tests will be " | 737 LOG(ERROR) << "Failed to find a non-loopback IP_V4 address. Tests will be " |
742 << "run over the loopback adapter, which may result in hangs."; | 738 << "run over the loopback adapter, which may result in hangs."; |
743 address.assign("127.0.0.1"); | 739 address.assign("127.0.0.1"); |
744 } | 740 } |
745 | 741 |
746 return address; | 742 return address; |
747 } | 743 } |
748 | 744 |
749 } // namespace chrome_frame_test | 745 } // namespace chrome_frame_test |
OLD | NEW |