| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/installer/util/delete_old_versions.h" | 5 #include "chrome/installer/util/delete_old_versions.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
| 10 #include "base/files/file_enumerator.h" | 10 #include "base/files/file_enumerator.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 FilePathSet* file_path_set) { | 88 FilePathSet* file_path_set) { |
| 89 file_path_set->insert(base::FilePath(version)); | 89 file_path_set->insert(base::FilePath(version)); |
| 90 file_path_set->insert(base::FilePath(version).Append(L"chrome.dll")); | 90 file_path_set->insert(base::FilePath(version).Append(L"chrome.dll")); |
| 91 file_path_set->insert(base::FilePath(version).Append(L"nacl64.exe")); | 91 file_path_set->insert(base::FilePath(version).Append(L"nacl64.exe")); |
| 92 file_path_set->insert(base::FilePath(version).Append(L"icudtl.dat")); | 92 file_path_set->insert(base::FilePath(version).Append(L"icudtl.dat")); |
| 93 file_path_set->insert(base::FilePath(version).Append(L"Installer")); | 93 file_path_set->insert(base::FilePath(version).Append(L"Installer")); |
| 94 file_path_set->insert( | 94 file_path_set->insert( |
| 95 base::FilePath(version).Append(L"Installer\\setup.exe")); | 95 base::FilePath(version).Append(L"Installer\\setup.exe")); |
| 96 } | 96 } |
| 97 | 97 |
| 98 base::FilePath install_dir() const { return install_dir_.path(); } | 98 base::FilePath install_dir() const { return install_dir_.GetPath(); } |
| 99 | 99 |
| 100 private: | 100 private: |
| 101 base::ScopedTempDir install_dir_; | 101 base::ScopedTempDir install_dir_; |
| 102 | 102 |
| 103 DISALLOW_COPY_AND_ASSIGN(DeleteOldVersionsTest); | 103 DISALLOW_COPY_AND_ASSIGN(DeleteOldVersionsTest); |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 } // namespace | 106 } // namespace |
| 107 | 107 |
| 108 // An old executable without a matching directory should be deleted. | 108 // An old executable without a matching directory should be deleted. |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 | 278 |
| 279 DeleteOldVersions(install_dir()); | 279 DeleteOldVersions(install_dir()); |
| 280 | 280 |
| 281 FilePathSet expected_install_dir_content; | 281 FilePathSet expected_install_dir_content; |
| 282 expected_install_dir_content.insert(base::FilePath(installer::kChromeExe)); | 282 expected_install_dir_content.insert(base::FilePath(installer::kChromeExe)); |
| 283 AddVersionFiles(version_b, &expected_install_dir_content); | 283 AddVersionFiles(version_b, &expected_install_dir_content); |
| 284 EXPECT_EQ(expected_install_dir_content, GetInstallDirContent()); | 284 EXPECT_EQ(expected_install_dir_content, GetInstallDirContent()); |
| 285 } | 285 } |
| 286 | 286 |
| 287 } // namespace installer | 287 } // namespace installer |
| OLD | NEW |