| 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_PRODUCT_STATE_H_ | 5 #ifndef CHROME_INSTALLER_UTIL_FAKE_PRODUCT_STATE_H_ |
| 6 #define CHROME_INSTALLER_UTIL_FAKE_PRODUCT_STATE_H_ | 6 #define CHROME_INSTALLER_UTIL_FAKE_PRODUCT_STATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include "chrome/installer/util/installation_state.h" | 9 #include "chrome/installer/util/installation_state.h" |
| 10 | 10 |
| 11 namespace installer { | 11 namespace installer { |
| 12 | 12 |
| 13 // A ProductState helper for use by unit tests. | 13 // A ProductState helper for use by unit tests. |
| 14 class FakeProductState : public ProductState { | 14 class FakeProductState : public ProductState { |
| 15 public: | 15 public: |
| 16 // Takes ownership of |version|. | 16 // Takes ownership of |version|. |
| 17 void set_version(Version* version) { version_.reset(version); } | 17 void set_version(base::Version* version) { version_.reset(version); } |
| 18 void set_multi_install(bool multi) { multi_install_ = multi; } | 18 void set_multi_install(bool multi) { multi_install_ = multi; } |
| 19 void set_brand(const std::wstring& brand) { brand_ = brand; } | 19 void set_brand(const std::wstring& brand) { brand_ = brand; } |
| 20 void set_usagestats(DWORD usagestats) { | 20 void set_usagestats(DWORD usagestats) { |
| 21 has_usagestats_ = true; | 21 has_usagestats_ = true; |
| 22 usagestats_ = usagestats; | 22 usagestats_ = usagestats; |
| 23 } | 23 } |
| 24 void clear_usagestats() { has_usagestats_ = false; } | 24 void clear_usagestats() { has_usagestats_ = false; } |
| 25 void SetUninstallProgram(const base::FilePath& setup_exe) { | 25 void SetUninstallProgram(const base::FilePath& setup_exe) { |
| 26 uninstall_command_ = base::CommandLine(setup_exe); | 26 uninstall_command_ = base::CommandLine(setup_exe); |
| 27 } | 27 } |
| 28 void AddUninstallSwitch(const std::string& option) { | 28 void AddUninstallSwitch(const std::string& option) { |
| 29 uninstall_command_.AppendSwitch(option); | 29 uninstall_command_.AppendSwitch(option); |
| 30 } | 30 } |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 } // namespace installer | 33 } // namespace installer |
| 34 | 34 |
| 35 #endif // CHROME_INSTALLER_UTIL_FAKE_PRODUCT_STATE_H_ | 35 #endif // CHROME_INSTALLER_UTIL_FAKE_PRODUCT_STATE_H_ |
| OLD | NEW |