blob: 176176b461b1f3ed1598f56e88efcda38da9b670 [file] [log] [blame]
Jay Srinivasan480ddfa2012-06-01 19:15:26 -07001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Darin Petkov1cbd78f2010-07-29 12:38:34 -07002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Alex Deymo8427b4a2014-11-05 14:00:32 -08005#ifndef UPDATE_ENGINE_MOCK_PREFS_H_
6#define UPDATE_ENGINE_MOCK_PREFS_H_
Darin Petkov1cbd78f2010-07-29 12:38:34 -07007
Alex Vakulenkod2779df2014-06-16 13:19:00 -07008#include <string>
9
Alex Deymo8427b4a2014-11-05 14:00:32 -080010#include <gmock/gmock.h>
11
Jay Srinivasand29695d2013-04-08 15:08:05 -070012#include "update_engine/constants.h"
Darin Petkov1cbd78f2010-07-29 12:38:34 -070013#include "update_engine/prefs_interface.h"
14
15namespace chromeos_update_engine {
16
Alex Deymo8427b4a2014-11-05 14:00:32 -080017class MockPrefs : public PrefsInterface {
Darin Petkov1cbd78f2010-07-29 12:38:34 -070018 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 Srinivasan480ddfa2012-06-01 19:15:26 -070024
Alex Deymoefb7c4c2013-07-09 14:34:00 -070025 MOCK_METHOD2(GetBoolean, bool(const std::string& key, bool* value));
26 MOCK_METHOD2(SetBoolean, bool(const std::string& key, const bool value));
27
Jay Srinivasan480ddfa2012-06-01 19:15:26 -070028 MOCK_METHOD1(Exists, bool(const std::string& key));
29 MOCK_METHOD1(Delete, bool(const std::string& key));
Darin Petkov1cbd78f2010-07-29 12:38:34 -070030};
31
32} // namespace chromeos_update_engine
33
Alex Deymo8427b4a2014-11-05 14:00:32 -080034#endif // UPDATE_ENGINE_MOCK_PREFS_H_