| 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, bool multi_install, Version* version) { | 21 void AddChrome(bool system_install, bool multi_install, |
| 22 base::Version* version) { |
| 22 FakeProductState chrome_state; | 23 FakeProductState chrome_state; |
| 23 chrome_state.set_version(version); | 24 chrome_state.set_version(version); |
| 24 chrome_state.set_multi_install(multi_install); | 25 chrome_state.set_multi_install(multi_install); |
| 25 base::FilePath setup_exe( | 26 base::FilePath setup_exe( |
| 26 GetChromeInstallPath(system_install, | 27 GetChromeInstallPath(system_install, |
| 27 BrowserDistribution::GetSpecificDistribution( | 28 BrowserDistribution::GetSpecificDistribution( |
| 28 BrowserDistribution::CHROME_BROWSER))); | 29 BrowserDistribution::CHROME_BROWSER))); |
| 29 setup_exe = setup_exe | 30 setup_exe = setup_exe |
| 30 .AppendASCII(version->GetString()) | 31 .AppendASCII(version->GetString()) |
| 31 .Append(kInstallerDir) | 32 .Append(kInstallerDir) |
| (...skipping 17 matching lines...) Expand all Loading... |
| 49 | 50 |
| 50 protected: | 51 protected: |
| 51 ProductState* GetProducts(bool system_install) { | 52 ProductState* GetProducts(bool system_install) { |
| 52 return system_install ? system_products_ : user_products_; | 53 return system_install ? system_products_ : user_products_; |
| 53 } | 54 } |
| 54 }; | 55 }; |
| 55 | 56 |
| 56 } // namespace installer | 57 } // namespace installer |
| 57 | 58 |
| 58 #endif // CHROME_INSTALLER_UTIL_FAKE_INSTALLATION_STATE_H_ | 59 #endif // CHROME_INSTALLER_UTIL_FAKE_INSTALLATION_STATE_H_ |
| OLD | NEW |