| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/update_client/test/test_installer.h" | 5 #include "components/update_client/test/test_installer.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 } | 26 } |
| 27 | 27 |
| 28 bool TestInstaller::GetInstalledFile(const std::string& file, | 28 bool TestInstaller::GetInstalledFile(const std::string& file, |
| 29 base::FilePath* installed_file) { | 29 base::FilePath* installed_file) { |
| 30 return false; | 30 return false; |
| 31 } | 31 } |
| 32 | 32 |
| 33 TestInstaller::~TestInstaller() { | 33 TestInstaller::~TestInstaller() { |
| 34 } | 34 } |
| 35 | 35 |
| 36 bool TestInstaller::Uninstall() { |
| 37 return false; |
| 38 } |
| 39 |
| 36 ReadOnlyTestInstaller::ReadOnlyTestInstaller(const base::FilePath& install_dir) | 40 ReadOnlyTestInstaller::ReadOnlyTestInstaller(const base::FilePath& install_dir) |
| 37 : install_directory_(install_dir) { | 41 : install_directory_(install_dir) { |
| 38 } | 42 } |
| 39 | 43 |
| 40 ReadOnlyTestInstaller::~ReadOnlyTestInstaller() { | 44 ReadOnlyTestInstaller::~ReadOnlyTestInstaller() { |
| 41 } | 45 } |
| 42 | 46 |
| 43 bool ReadOnlyTestInstaller::GetInstalledFile(const std::string& file, | 47 bool ReadOnlyTestInstaller::GetInstalledFile(const std::string& file, |
| 44 base::FilePath* installed_file) { | 48 base::FilePath* installed_file) { |
| 45 *installed_file = install_directory_.AppendASCII(file); | 49 *installed_file = install_directory_.AppendASCII(file); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 72 | 76 |
| 73 bool VersionedTestInstaller::GetInstalledFile(const std::string& file, | 77 bool VersionedTestInstaller::GetInstalledFile(const std::string& file, |
| 74 base::FilePath* installed_file) { | 78 base::FilePath* installed_file) { |
| 75 base::FilePath path; | 79 base::FilePath path; |
| 76 path = install_directory_.AppendASCII(current_version_.GetString()); | 80 path = install_directory_.AppendASCII(current_version_.GetString()); |
| 77 *installed_file = path.Append(base::FilePath::FromUTF8Unsafe(file)); | 81 *installed_file = path.Append(base::FilePath::FromUTF8Unsafe(file)); |
| 78 return true; | 82 return true; |
| 79 } | 83 } |
| 80 | 84 |
| 81 } // namespace update_client | 85 } // namespace update_client |
| OLD | NEW |