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