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 #ifndef COMPONENTS_UPDATE_CLIENT_TEST_TEST_INSTALLER_H_ | 5 #ifndef COMPONENTS_UPDATE_CLIENT_TEST_TEST_INSTALLER_H_ |
6 #define COMPONENTS_UPDATE_CLIENT_TEST_TEST_INSTALLER_H_ | 6 #define COMPONENTS_UPDATE_CLIENT_TEST_TEST_INSTALLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 TestInstaller(); | 24 TestInstaller(); |
25 | 25 |
26 void OnUpdateError(int error) override; | 26 void OnUpdateError(int error) override; |
27 | 27 |
28 bool Install(const base::DictionaryValue& manifest, | 28 bool Install(const base::DictionaryValue& manifest, |
29 const base::FilePath& unpack_path) override; | 29 const base::FilePath& unpack_path) override; |
30 | 30 |
31 bool GetInstalledFile(const std::string& file, | 31 bool GetInstalledFile(const std::string& file, |
32 base::FilePath* installed_file) override; | 32 base::FilePath* installed_file) override; |
33 | 33 |
34 int error() const; | 34 int error() const { |
| 35 return error_; |
| 36 } |
35 | 37 |
36 int install_count() const; | 38 int install_count() const { |
| 39 return install_count_; |
| 40 } |
37 | 41 |
38 protected: | 42 protected: |
| 43 ~TestInstaller() override; |
| 44 |
39 int error_; | 45 int error_; |
40 int install_count_; | 46 int install_count_; |
41 }; | 47 }; |
42 | 48 |
43 // A ReadOnlyTestInstaller is an installer that knows about files in an existing | 49 // A ReadOnlyTestInstaller is an installer that knows about files in an existing |
44 // directory. It will not write to the directory. | 50 // directory. It will not write to the directory. |
45 class ReadOnlyTestInstaller : public TestInstaller { | 51 class ReadOnlyTestInstaller : public TestInstaller { |
46 public: | 52 public: |
47 explicit ReadOnlyTestInstaller(const base::FilePath& installed_path); | 53 explicit ReadOnlyTestInstaller(const base::FilePath& installed_path); |
48 | 54 |
49 ~ReadOnlyTestInstaller() override; | |
50 | |
51 bool GetInstalledFile(const std::string& file, | 55 bool GetInstalledFile(const std::string& file, |
52 base::FilePath* installed_file) override; | 56 base::FilePath* installed_file) override; |
53 | 57 |
54 private: | 58 private: |
| 59 ~ReadOnlyTestInstaller() override; |
| 60 |
55 base::FilePath install_directory_; | 61 base::FilePath install_directory_; |
56 }; | 62 }; |
57 | 63 |
58 // A VersionedTestInstaller is an installer that installs files into versioned | 64 // A VersionedTestInstaller is an installer that installs files into versioned |
59 // directories (e.g. somedir/25.23.89.141/<files>). | 65 // directories (e.g. somedir/25.23.89.141/<files>). |
60 class VersionedTestInstaller : public TestInstaller { | 66 class VersionedTestInstaller : public TestInstaller { |
61 public: | 67 public: |
62 VersionedTestInstaller(); | 68 VersionedTestInstaller(); |
63 | 69 |
64 ~VersionedTestInstaller() override; | |
65 | |
66 bool Install(const base::DictionaryValue& manifest, | 70 bool Install(const base::DictionaryValue& manifest, |
67 const base::FilePath& unpack_path) override; | 71 const base::FilePath& unpack_path) override; |
68 | 72 |
69 bool GetInstalledFile(const std::string& file, | 73 bool GetInstalledFile(const std::string& file, |
70 base::FilePath* installed_file) override; | 74 base::FilePath* installed_file) override; |
71 | 75 |
72 private: | 76 private: |
| 77 ~VersionedTestInstaller() override; |
| 78 |
73 base::FilePath install_directory_; | 79 base::FilePath install_directory_; |
74 Version current_version_; | 80 Version current_version_; |
75 }; | 81 }; |
76 | 82 |
77 } // namespace update_client | 83 } // namespace update_client |
78 | 84 |
79 #endif // COMPONENTS_UPDATE_CLIENT_TEST_TEST_INSTALLER_H_ | 85 #endif // COMPONENTS_UPDATE_CLIENT_TEST_TEST_INSTALLER_H_ |
OLD | NEW |