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.
5 #include "chromeos/dbus/fake_ap_manager_client.h"
7 #include "base/location.h"
8 #include "base/thread_task_runner_handle.h"
13 void ObjectPathDBBusMethodCallbackThunk(
14 const ObjectPathDBusMethodCallback
& callback
) {
15 callback
.Run(DBUS_METHOD_CALL_SUCCESS
, dbus::ObjectPath());
18 void VoidDBBusMethodCallbackThunk(const VoidDBusMethodCallback
& callback
) {
19 callback
.Run(DBUS_METHOD_CALL_SUCCESS
);
23 FakeApManagerClient::FakeApManagerClient() {
26 FakeApManagerClient::~FakeApManagerClient() {
29 void FakeApManagerClient::Init(dbus::Bus
* bus
) {
32 void FakeApManagerClient::AddObserver(Observer
* observer
) {
35 void FakeApManagerClient::RemoveObserver(Observer
* observer
) {
38 void FakeApManagerClient::CreateService(
39 const ObjectPathDBusMethodCallback
& callback
) {
40 base::ThreadTaskRunnerHandle::Get()->PostTask(
41 FROM_HERE
, base::Bind(&ObjectPathDBBusMethodCallbackThunk
, callback
));
44 void FakeApManagerClient::RemoveService(
45 const dbus::ObjectPath
& object_path
,
46 const VoidDBusMethodCallback
& callback
) {
47 base::ThreadTaskRunnerHandle::Get()->PostTask(
48 FROM_HERE
, base::Bind(&VoidDBBusMethodCallbackThunk
, callback
));
51 void FakeApManagerClient::StartService(const dbus::ObjectPath
& object_path
,
52 const VoidDBusMethodCallback
& callback
) {
53 base::ThreadTaskRunnerHandle::Get()->PostTask(
54 FROM_HERE
, base::Bind(&VoidDBBusMethodCallbackThunk
, callback
));
57 void FakeApManagerClient::StopService(const dbus::ObjectPath
& object_path
,
58 const VoidDBusMethodCallback
& callback
) {
59 base::ThreadTaskRunnerHandle::Get()->PostTask(
60 FROM_HERE
, base::Bind(&VoidDBBusMethodCallbackThunk
, callback
));
63 ApManagerClient::ConfigProperties
* FakeApManagerClient::GetConfigProperties(
64 const dbus::ObjectPath
& object_path
) {
68 const ApManagerClient::DeviceProperties
*
69 FakeApManagerClient::GetDeviceProperties(const dbus::ObjectPath
& object_path
) {
73 const ApManagerClient::ServiceProperties
*
74 FakeApManagerClient::GetServiceProperties(const dbus::ObjectPath
& object_path
) {
78 } // namespace chromeos