OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_INSTALLER_UTIL_FAKE_INSTALLATION_STATE_H_ | 5 #ifndef CHROME_INSTALLER_UTIL_FAKE_INSTALLATION_STATE_H_ |
6 #define CHROME_INSTALLER_UTIL_FAKE_INSTALLATION_STATE_H_ | 6 #define CHROME_INSTALLER_UTIL_FAKE_INSTALLATION_STATE_H_ |
7 | 7 |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/version.h" | 9 #include "base/version.h" |
10 #include "chrome/installer/util/fake_product_state.h" | 10 #include "chrome/installer/util/fake_product_state.h" |
11 #include "chrome/installer/util/helper.h" | 11 #include "chrome/installer/util/helper.h" |
12 #include "chrome/installer/util/installation_state.h" | 12 #include "chrome/installer/util/installation_state.h" |
13 #include "chrome/installer/util/util_constants.h" | 13 #include "chrome/installer/util/util_constants.h" |
14 | 14 |
15 namespace installer { | 15 namespace installer { |
16 | 16 |
17 // An InstallationState helper for use by unit tests. | 17 // An InstallationState helper for use by unit tests. |
18 class FakeInstallationState : public InstallationState { | 18 class FakeInstallationState : public InstallationState { |
19 public: | 19 public: |
20 // Takes ownership of |version|. | 20 // Takes ownership of |version|. |
21 void AddChrome(bool system_install, | 21 void AddChrome(bool system_install, bool multi_install, Version* version) { |
22 bool multi_install, | |
23 base::Version* version) { | |
24 FakeProductState chrome_state; | 22 FakeProductState chrome_state; |
25 chrome_state.set_version(version); | 23 chrome_state.set_version(version); |
26 chrome_state.set_multi_install(multi_install); | 24 chrome_state.set_multi_install(multi_install); |
27 base::FilePath setup_exe( | 25 base::FilePath setup_exe( |
28 GetChromeInstallPath(system_install, | 26 GetChromeInstallPath(system_install, |
29 BrowserDistribution::GetSpecificDistribution( | 27 BrowserDistribution::GetSpecificDistribution( |
30 BrowserDistribution::CHROME_BROWSER))); | 28 BrowserDistribution::CHROME_BROWSER))); |
31 setup_exe = setup_exe | 29 setup_exe = setup_exe |
32 .AppendASCII(version->GetString()) | 30 .AppendASCII(version->GetString()) |
33 .Append(kInstallerDir) | 31 .Append(kInstallerDir) |
(...skipping 17 matching lines...) Expand all Loading... |
51 | 49 |
52 protected: | 50 protected: |
53 ProductState* GetProducts(bool system_install) { | 51 ProductState* GetProducts(bool system_install) { |
54 return system_install ? system_products_ : user_products_; | 52 return system_install ? system_products_ : user_products_; |
55 } | 53 } |
56 }; | 54 }; |
57 | 55 |
58 } // namespace installer | 56 } // namespace installer |
59 | 57 |
60 #endif // CHROME_INSTALLER_UTIL_FAKE_INSTALLATION_STATE_H_ | 58 #endif // CHROME_INSTALLER_UTIL_FAKE_INSTALLATION_STATE_H_ |
OLD | NEW |