mock_exported_object.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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
  3. // found in the LICENSE file.
  4. #ifndef DBUS_MOCK_EXPORTED_OBJECT_H_
  5. #define DBUS_MOCK_EXPORTED_OBJECT_H_
  6. #include <string>
  7. #include "dbus/exported_object.h"
  8. #include "dbus/object_path.h"
  9. #include "testing/gmock/include/gmock/gmock.h"
  10. namespace dbus {
  11. // Mock for ExportedObject.
  12. class MockExportedObject : public ExportedObject {
  13. public:
  14. MockExportedObject(Bus* bus,
  15. const ObjectPath& object_path);
  16. MOCK_METHOD3(ExportMethodAndBlock,
  17. bool(const std::string& interface_name,
  18. const std::string& method_name,
  19. const MethodCallCallback& method_call_callback));
  20. MOCK_METHOD4(ExportMethod,
  21. void(const std::string& interface_name,
  22. const std::string& method_name,
  23. const MethodCallCallback& method_call_callback,
  24. OnExportedCallback on_exported_callback));
  25. MOCK_METHOD2(UnexportMethodAndBlock,
  26. bool(const std::string& interface_name,
  27. const std::string& method_name));
  28. MOCK_METHOD3(UnexportMethod,
  29. void(const std::string& interface_name,
  30. const std::string& method_name,
  31. OnUnexportedCallback on_unexported_callback));
  32. MOCK_METHOD1(SendSignal, void(Signal* signal));
  33. MOCK_METHOD0(Unregister, void());
  34. protected:
  35. ~MockExportedObject() override;
  36. };
  37. } // namespace dbus
  38. #endif // DBUS_MOCK_EXPORTED_OBJECT_H_