summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/bluetooth/test/mock_bluetooth_device.cc
blob: 1387fd2725a42faace0f7c61d84eb7d426dc4c3c (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
// Copyright (c) 2012 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.

#include "base/utf_string_conversions.h"
#include "chrome/browser/chromeos/bluetooth/test/mock_bluetooth_adapter.h"
#include "chrome/browser/chromeos/bluetooth/test/mock_bluetooth_device.h"

namespace chromeos {

MockBluetoothDevice::MockBluetoothDevice(MockBluetoothAdapter* adapter,
                                         const std::string& name,
                                         const std::string& address,
                                         bool paired,
                                         bool bonded,
                                         bool connected)
    : name_(UTF8ToUTF16(name)),
      address_(address) {
  ON_CALL(*this, GetName())
      .WillByDefault(testing::Return(name_));
  ON_CALL(*this, address())
      .WillByDefault(testing::ReturnRef(address_));
  ON_CALL(*this, IsPaired())
      .WillByDefault(testing::Return(paired));
  ON_CALL(*this, IsBonded())
      .WillByDefault(testing::Return(bonded));
  ON_CALL(*this, IsConnected())
      .WillByDefault(testing::Return(connected));
  ON_CALL(*this, ExpectingPinCode())
      .WillByDefault(testing::Return(false));
  ON_CALL(*this, ExpectingPasskey())
      .WillByDefault(testing::Return(false));
  ON_CALL(*this, ExpectingConfirmation())
      .WillByDefault(testing::Return(false));
  ON_CALL(*this, GetServices())
      .WillByDefault(testing::ReturnRef(service_list_));
}

MockBluetoothDevice::~MockBluetoothDevice() {}

}  // namespace chromeos