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 12 matching lines...) Expand all Loading... |
23 const base::FilePath& unpack_path) { | 23 const base::FilePath& unpack_path) { |
24 ++install_count_; | 24 ++install_count_; |
25 return base::DeleteFile(unpack_path, true); | 25 return base::DeleteFile(unpack_path, true); |
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 int TestInstaller::error() const { | 33 TestInstaller::~TestInstaller() { |
34 return error_; | |
35 } | |
36 | |
37 int TestInstaller::install_count() const { | |
38 return install_count_; | |
39 } | 34 } |
40 | 35 |
41 ReadOnlyTestInstaller::ReadOnlyTestInstaller(const base::FilePath& install_dir) | 36 ReadOnlyTestInstaller::ReadOnlyTestInstaller(const base::FilePath& install_dir) |
42 : install_directory_(install_dir) { | 37 : install_directory_(install_dir) { |
43 } | 38 } |
44 | 39 |
45 ReadOnlyTestInstaller::~ReadOnlyTestInstaller() { | 40 ReadOnlyTestInstaller::~ReadOnlyTestInstaller() { |
46 } | 41 } |
47 | 42 |
48 bool ReadOnlyTestInstaller::GetInstalledFile(const std::string& file, | 43 bool ReadOnlyTestInstaller::GetInstalledFile(const std::string& file, |
(...skipping 28 matching lines...) Expand all Loading... |
77 | 72 |
78 bool VersionedTestInstaller::GetInstalledFile(const std::string& file, | 73 bool VersionedTestInstaller::GetInstalledFile(const std::string& file, |
79 base::FilePath* installed_file) { | 74 base::FilePath* installed_file) { |
80 base::FilePath path; | 75 base::FilePath path; |
81 path = install_directory_.AppendASCII(current_version_.GetString()); | 76 path = install_directory_.AppendASCII(current_version_.GetString()); |
82 *installed_file = path.Append(base::FilePath::FromUTF8Unsafe(file)); | 77 *installed_file = path.Append(base::FilePath::FromUTF8Unsafe(file)); |
83 return true; | 78 return true; |
84 } | 79 } |
85 | 80 |
86 } // namespace update_client | 81 } // namespace update_client |
OLD | NEW |