• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
5 #include "dbus/mock_object_proxy.h"
6 
7 namespace dbus {
8 
MockObjectProxy(Bus * bus,const std::string & service_name,const ObjectPath & object_path)9 MockObjectProxy::MockObjectProxy(Bus* bus,
10                                  const std::string& service_name,
11                                  const ObjectPath& object_path)
12     : ObjectProxy(bus, service_name, object_path, DEFAULT_OPTIONS) {
13 }
14 
15 MockObjectProxy::~MockObjectProxy() = default;
16 
CallMethod(MethodCall * method_call,int timeout_ms,ResponseCallback callback)17 void MockObjectProxy::CallMethod(MethodCall* method_call,
18                                  int timeout_ms,
19                                  ResponseCallback callback) {
20   DoCallMethod(method_call, timeout_ms, &callback);
21 }
22 
CallMethodWithErrorResponse(MethodCall * method_call,int timeout_ms,ResponseOrErrorCallback callback)23 void MockObjectProxy::CallMethodWithErrorResponse(
24     MethodCall* method_call,
25     int timeout_ms,
26     ResponseOrErrorCallback callback) {
27   DoCallMethodWithErrorResponse(method_call, timeout_ms, &callback);
28 }
29 
CallMethodWithErrorCallback(MethodCall * method_call,int timeout_ms,ResponseCallback callback,ErrorCallback error_callback)30 void MockObjectProxy::CallMethodWithErrorCallback(
31     MethodCall* method_call,
32     int timeout_ms,
33     ResponseCallback callback,
34     ErrorCallback error_callback) {
35   DoCallMethodWithErrorCallback(method_call, timeout_ms, &callback,
36                                 &error_callback);
37 }
38 
ConnectToSignal(const std::string & interface_name,const std::string & signal_name,SignalCallback signal_callback,OnConnectedCallback on_connected_callback)39 void MockObjectProxy::ConnectToSignal(
40     const std::string& interface_name,
41     const std::string& signal_name,
42     SignalCallback signal_callback,
43     OnConnectedCallback on_connected_callback) {
44   DoConnectToSignal(interface_name, signal_name, signal_callback,
45                     &on_connected_callback);
46 }
47 
48 }  // namespace dbus
49