xref: /aosp_15_r20/external/libchrome/dbus/mock_exported_object.h (revision 635a864187cb8b6c713ff48b7e790a6b21769273)
1*635a8641SAndroid Build Coastguard Worker // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2*635a8641SAndroid Build Coastguard Worker // Use of this source code is governed by a BSD-style license that can be
3*635a8641SAndroid Build Coastguard Worker // found in the LICENSE file.
4*635a8641SAndroid Build Coastguard Worker 
5*635a8641SAndroid Build Coastguard Worker #ifndef DBUS_MOCK_EXPORTED_OBJECT_H_
6*635a8641SAndroid Build Coastguard Worker #define DBUS_MOCK_EXPORTED_OBJECT_H_
7*635a8641SAndroid Build Coastguard Worker 
8*635a8641SAndroid Build Coastguard Worker #include <string>
9*635a8641SAndroid Build Coastguard Worker 
10*635a8641SAndroid Build Coastguard Worker #include "dbus/exported_object.h"
11*635a8641SAndroid Build Coastguard Worker #include "dbus/object_path.h"
12*635a8641SAndroid Build Coastguard Worker #include "testing/gmock/include/gmock/gmock.h"
13*635a8641SAndroid Build Coastguard Worker 
14*635a8641SAndroid Build Coastguard Worker namespace dbus {
15*635a8641SAndroid Build Coastguard Worker 
16*635a8641SAndroid Build Coastguard Worker // Mock for ExportedObject.
17*635a8641SAndroid Build Coastguard Worker class MockExportedObject : public ExportedObject {
18*635a8641SAndroid Build Coastguard Worker  public:
19*635a8641SAndroid Build Coastguard Worker   MockExportedObject(Bus* bus,
20*635a8641SAndroid Build Coastguard Worker                      const ObjectPath& object_path);
21*635a8641SAndroid Build Coastguard Worker 
22*635a8641SAndroid Build Coastguard Worker   MOCK_METHOD3(ExportMethodAndBlock,
23*635a8641SAndroid Build Coastguard Worker                bool(const std::string& interface_name,
24*635a8641SAndroid Build Coastguard Worker                     const std::string& method_name,
25*635a8641SAndroid Build Coastguard Worker                     MethodCallCallback method_call_callback));
26*635a8641SAndroid Build Coastguard Worker   MOCK_METHOD4(ExportMethod,
27*635a8641SAndroid Build Coastguard Worker                void(const std::string& interface_name,
28*635a8641SAndroid Build Coastguard Worker                     const std::string& method_name,
29*635a8641SAndroid Build Coastguard Worker                     MethodCallCallback method_call_callback,
30*635a8641SAndroid Build Coastguard Worker                     OnExportedCallback on_exported_callback));
31*635a8641SAndroid Build Coastguard Worker   MOCK_METHOD1(SendSignal, void(Signal* signal));
32*635a8641SAndroid Build Coastguard Worker   MOCK_METHOD0(Unregister, void());
33*635a8641SAndroid Build Coastguard Worker 
34*635a8641SAndroid Build Coastguard Worker  protected:
35*635a8641SAndroid Build Coastguard Worker   ~MockExportedObject() override;
36*635a8641SAndroid Build Coastguard Worker };
37*635a8641SAndroid Build Coastguard Worker 
38*635a8641SAndroid Build Coastguard Worker }  // namespace dbus
39*635a8641SAndroid Build Coastguard Worker 
40*635a8641SAndroid Build Coastguard Worker #endif  // DBUS_MOCK_EXPORTED_OBJECT_H_
41