Android: Get rid of extra dup()s on launching child processes
[chromium-blink-merge.git] / chrome / installer / util / fake_product_state.h
blob8b6e866fb3c0b9eda4d9b593a7afc22789e674ff
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
3 // found in the LICENSE file.
5 #ifndef CHROME_INSTALLER_UTIL_FAKE_PRODUCT_STATE_H_
6 #define CHROME_INSTALLER_UTIL_FAKE_PRODUCT_STATE_H_
8 #include <string>
9 #include "chrome/installer/util/installation_state.h"
11 namespace installer {
13 // A ProductState helper for use by unit tests.
14 class FakeProductState : public ProductState {
15 public:
16 // Takes ownership of |version|.
17 void set_version(Version* version) { version_.reset(version); }
18 void set_multi_install(bool multi) { multi_install_ = multi; }
19 void set_brand(const std::wstring& brand) { brand_ = brand; }
20 void set_usagestats(DWORD usagestats) {
21 has_usagestats_ = true;
22 usagestats_ = usagestats;
24 void clear_usagestats() { has_usagestats_ = false; }
25 void SetUninstallProgram(const base::FilePath& setup_exe) {
26 uninstall_command_ = base::CommandLine(setup_exe);
28 void AddUninstallSwitch(const std::string& option) {
29 uninstall_command_.AppendSwitch(option);
33 } // namespace installer
35 #endif // CHROME_INSTALLER_UTIL_FAKE_PRODUCT_STATE_H_