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/test/mini_installer_test/installer_test_util.h" | 5 #include "chrome/test/mini_installer_test/installer_test_util.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/process.h" | 9 #include "base/process.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 std::string version = GetVersion(type); | 55 std::string version = GetVersion(type); |
56 if (version.empty()) | 56 if (version.empty()) |
57 return false; | 57 return false; |
58 base::FilePath path; | 58 base::FilePath path; |
59 bool has_install_dir = GetInstallDirectory(system_level, | 59 bool has_install_dir = GetInstallDirectory(system_level, |
60 ToBrowserDistributionType(type), | 60 ToBrowserDistributionType(type), |
61 &path); | 61 &path); |
62 if (!has_install_dir || !base::PathExists(path)) | 62 if (!has_install_dir || !base::PathExists(path)) |
63 return false; | 63 return false; |
64 path = path.AppendASCII(version); | 64 path = path.AppendASCII(version); |
65 return base::Delete(path, true); | 65 return base::DeleteFile(path, true); |
66 } | 66 } |
67 | 67 |
68 bool DeleteRegistryKey(bool system_level, | 68 bool DeleteRegistryKey(bool system_level, |
69 InstallationValidator::InstallationType type) { | 69 InstallationValidator::InstallationType type) { |
70 BrowserDistribution* dist = BrowserDistribution::GetSpecificDistribution( | 70 BrowserDistribution* dist = BrowserDistribution::GetSpecificDistribution( |
71 ToBrowserDistributionType(type)); | 71 ToBrowserDistributionType(type)); |
72 base::FilePath::StringType key(google_update::kRegPathClients); | 72 base::FilePath::StringType key(google_update::kRegPathClients); |
73 key.push_back(base::FilePath::kSeparators[0]); | 73 key.push_back(base::FilePath::kSeparators[0]); |
74 key.append(dist->GetAppGuid()); | 74 key.append(dist->GetAppGuid()); |
75 HKEY root = system_level ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; | 75 HKEY root = system_level ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 return false; | 291 return false; |
292 } | 292 } |
293 if (!base::WaitForSingleProcess(process, base::TimeDelta::FromMinutes(1))) { | 293 if (!base::WaitForSingleProcess(process, base::TimeDelta::FromMinutes(1))) { |
294 LOG(ERROR) << "Launched process did not complete."; | 294 LOG(ERROR) << "Launched process did not complete."; |
295 return false; | 295 return false; |
296 } | 296 } |
297 return true; | 297 return true; |
298 } | 298 } |
299 | 299 |
300 } // namespace | 300 } // namespace |
OLD | NEW |