Jay Srinivasan | 480ddfa | 2012-06-01 19:15:26 -0700 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
Darin Petkov | 1cbd78f | 2010-07-29 12:38:34 -0700 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Alex Deymo | 8427b4a | 2014-11-05 14:00:32 -0800 | [diff] [blame] | 5 | #ifndef UPDATE_ENGINE_MOCK_PREFS_H_ |
| 6 | #define UPDATE_ENGINE_MOCK_PREFS_H_ |
Darin Petkov | 1cbd78f | 2010-07-29 12:38:34 -0700 | [diff] [blame] | 7 | |
Alex Vakulenko | d2779df | 2014-06-16 13:19:00 -0700 | [diff] [blame] | 8 | #include <string> |
| 9 | |
Alex Deymo | 8427b4a | 2014-11-05 14:00:32 -0800 | [diff] [blame] | 10 | #include <gmock/gmock.h> |
| 11 | |
Jay Srinivasan | d29695d | 2013-04-08 15:08:05 -0700 | [diff] [blame] | 12 | #include "update_engine/constants.h" |
Darin Petkov | 1cbd78f | 2010-07-29 12:38:34 -0700 | [diff] [blame] | 13 | #include "update_engine/prefs_interface.h" |
| 14 | |
| 15 | namespace chromeos_update_engine { |
| 16 | |
Alex Deymo | 8427b4a | 2014-11-05 14:00:32 -0800 | [diff] [blame] | 17 | class MockPrefs : public PrefsInterface { |
Darin Petkov | 1cbd78f | 2010-07-29 12:38:34 -0700 | [diff] [blame] | 18 | public: |
| 19 | MOCK_METHOD2(GetString, bool(const std::string& key, std::string* value)); |
| 20 | MOCK_METHOD2(SetString, bool(const std::string& key, |
| 21 | const std::string& value)); |
| 22 | MOCK_METHOD2(GetInt64, bool(const std::string& key, int64_t* value)); |
| 23 | MOCK_METHOD2(SetInt64, bool(const std::string& key, const int64_t value)); |
Jay Srinivasan | 480ddfa | 2012-06-01 19:15:26 -0700 | [diff] [blame] | 24 | |
Alex Deymo | efb7c4c | 2013-07-09 14:34:00 -0700 | [diff] [blame] | 25 | MOCK_METHOD2(GetBoolean, bool(const std::string& key, bool* value)); |
| 26 | MOCK_METHOD2(SetBoolean, bool(const std::string& key, const bool value)); |
| 27 | |
Jay Srinivasan | 480ddfa | 2012-06-01 19:15:26 -0700 | [diff] [blame] | 28 | MOCK_METHOD1(Exists, bool(const std::string& key)); |
| 29 | MOCK_METHOD1(Delete, bool(const std::string& key)); |
Darin Petkov | 1cbd78f | 2010-07-29 12:38:34 -0700 | [diff] [blame] | 30 | }; |
| 31 | |
| 32 | } // namespace chromeos_update_engine |
| 33 | |
Alex Deymo | 8427b4a | 2014-11-05 14:00:32 -0800 | [diff] [blame] | 34 | #endif // UPDATE_ENGINE_MOCK_PREFS_H_ |