OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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. |
| 4 |
| 5 #ifndef CHROMEOS_DBUS_FAKE_LEADERSHIP_DAEMON_MANAGER_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_FAKE_LEADERSHIP_DAEMON_MANAGER_CLIENT_H_ |
| 7 |
| 8 #include <map> |
| 9 #include <string> |
| 10 #include <vector> |
| 11 |
| 12 #include "chromeos/dbus/leadership_daemon_manager_client.h" |
| 13 |
| 14 namespace chromeos { |
| 15 |
| 16 // A fake implementation of LeadershipDaemonManagerClient. Invokes callbacks |
| 17 // immediately. |
| 18 class FakeLeadershipDaemonManagerClient : public LeadershipDaemonManagerClient { |
| 19 public: |
| 20 FakeLeadershipDaemonManagerClient(); |
| 21 ~FakeLeadershipDaemonManagerClient() override; |
| 22 |
| 23 // DBusClient overrides: |
| 24 void Init(dbus::Bus* bus) override; |
| 25 |
| 26 // LeadershipDaemonManagerClient overrides: |
| 27 void AddObserver(Observer* observer) override; |
| 28 void RemoveObserver(Observer* observer) override; |
| 29 void JoinGroup(const std::string& group, |
| 30 const base::DictionaryValue& options, |
| 31 const StringDBusMethodCallback& callback) override; |
| 32 void LeaveGroup(const std::string& object_path, |
| 33 const VoidDBusMethodCallback& callback) override; |
| 34 void SetScore(const std::string& object_path, |
| 35 int score, |
| 36 const VoidDBusMethodCallback& callback) override; |
| 37 void PokeLeader(const std::string& object_path, |
| 38 const VoidDBusMethodCallback& callback) override; |
| 39 void Ping(const StringDBusMethodCallback& callback) override; |
| 40 const GroupProperties* GetGroupProperties( |
| 41 const dbus::ObjectPath& object_path) override; |
| 42 |
| 43 private: |
| 44 DISALLOW_COPY_AND_ASSIGN(FakeLeadershipDaemonManagerClient); |
| 45 }; |
| 46 |
| 47 } // namespace chromeos |
| 48 |
| 49 #endif // CHROMEOS_DBUS_FAKE_LEADERSHIP_DAEMON_MANAGER_CLIENT_H_ |
OLD | NEW |