| 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 "chrome/browser/component_updater/test/test_installer.h" | 5 #include "chrome/browser/component_updater/test/test_installer.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 | 10 |
| 11 namespace component_updater { |
| 12 |
| 11 TestInstaller::TestInstaller() | 13 TestInstaller::TestInstaller() |
| 12 : error_(0), install_count_(0) { | 14 : error_(0), install_count_(0) { |
| 13 } | 15 } |
| 14 | 16 |
| 15 void TestInstaller::OnUpdateError(int error) { | 17 void TestInstaller::OnUpdateError(int error) { |
| 16 error_ = error; | 18 error_ = error; |
| 17 } | 19 } |
| 18 | 20 |
| 19 bool TestInstaller::Install(const base::DictionaryValue& manifest, | 21 bool TestInstaller::Install(const base::DictionaryValue& manifest, |
| 20 const base::FilePath& unpack_path) { | 22 const base::FilePath& unpack_path) { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 return true; | 73 return true; |
| 72 } | 74 } |
| 73 | 75 |
| 74 bool VersionedTestInstaller::GetInstalledFile(const std::string& file, | 76 bool VersionedTestInstaller::GetInstalledFile(const std::string& file, |
| 75 base::FilePath* installed_file) { | 77 base::FilePath* installed_file) { |
| 76 base::FilePath path; | 78 base::FilePath path; |
| 77 path = install_directory_.AppendASCII(current_version_.GetString()); | 79 path = install_directory_.AppendASCII(current_version_.GetString()); |
| 78 *installed_file = path.Append(base::FilePath::FromUTF8Unsafe(file)); | 80 *installed_file = path.Append(base::FilePath::FromUTF8Unsafe(file)); |
| 79 return true; | 81 return true; |
| 80 } | 82 } |
| 83 |
| 84 } // namespace component_updater |
| 85 |
| OLD | NEW |