summaryrefslogtreecommitdiffstats
path: root/chromeos/dbus/fake_bluetooth_media_endpoint_service_provider.h
blob: 54acd65f3b29ed523996be9521a0974ea7260abf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROMEOS_DBUS_FAKE_BLUETOOTH_MEDIA_ENDPOINT_SERVICE_PROVIDER_H_
#define CHROMEOS_DBUS_FAKE_BLUETOOTH_MEDIA_ENDPOINT_SERVICE_PROVIDER_H_

#include <vector>

#include "base/logging.h"
#include "chromeos/chromeos_export.h"
#include "chromeos/dbus/bluetooth_media_endpoint_service_provider.h"
#include "dbus/object_path.h"

namespace chromeos {

// FakeBluetoothMediaEndpointServiceProvider simulates the behavior of a local
// Bluetooth Media Endpoint object.
// TODO(mcchou): Add the logic of the behavior.
class CHROMEOS_EXPORT FakeBluetoothMediaEndpointServiceProvider
    : public BluetoothMediaEndpointServiceProvider {
 public:
  FakeBluetoothMediaEndpointServiceProvider(const dbus::ObjectPath object_path,
                                            Delegate* delegate);
  ~FakeBluetoothMediaEndpointServiceProvider() override;

  // Each of these calls the equivalent BluetoothMediaEnpointServiceProvider::
  // Delegate method on the object passed on construction.
  void SetConfiguration(const dbus::ObjectPath& transport_path,
                        const dbus::MessageReader& properties);
  void SelectConfiguration(
      const std::vector<uint8_t>& capabilities,
      const Delegate::SelectConfigurationCallback& callback);
  void ClearConfiguration(const dbus::ObjectPath& transport_path);
  void Release();

 private:
  // The fake D-Bus object path.
  dbus::ObjectPath object_path_;

  // All incoming method calls are passed to |delegate_|. |callback| passed to
  // |delegate_| will generate the response for those methods which have
  // non-void return.
  Delegate* delegate_;

  DISALLOW_COPY_AND_ASSIGN(FakeBluetoothMediaEndpointServiceProvider);
};

}  // namespace chromeos

#endif  // CHROMEOS_DBUS_FAKE_BLUETOOTH_MEDIA_ENDPOINT_SERVICE_PROVIDER_H_