Home | History | Annotate | Download | only in test
      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 "device/bluetooth/test/mock_bluetooth_device.h"
      6 
      7 #include "base/strings/utf_string_conversions.h"
      8 #include "device/bluetooth/test/mock_bluetooth_adapter.h"
      9 
     10 namespace device {
     11 
     12 MockBluetoothDevice::MockBluetoothDevice(MockBluetoothAdapter* adapter,
     13                                          uint32 bluetooth_class,
     14                                          const std::string& name,
     15                                          const std::string& address,
     16                                          bool paired,
     17                                          bool connected)
     18     : bluetooth_class_(bluetooth_class),
     19       name_(name),
     20       address_(address) {
     21   ON_CALL(*this, GetBluetoothClass())
     22       .WillByDefault(testing::Return(bluetooth_class_));
     23   ON_CALL(*this, GetDeviceName())
     24       .WillByDefault(testing::Return(name_));
     25   ON_CALL(*this, GetAddress())
     26       .WillByDefault(testing::Return(address_));
     27   ON_CALL(*this, IsPaired())
     28       .WillByDefault(testing::Return(paired));
     29   ON_CALL(*this, IsConnected())
     30       .WillByDefault(testing::Return(connected));
     31   ON_CALL(*this, IsConnectable())
     32       .WillByDefault(testing::Return(false));
     33   ON_CALL(*this, IsConnecting())
     34       .WillByDefault(testing::Return(false));
     35   ON_CALL(*this, GetName())
     36       .WillByDefault(testing::Return(UTF8ToUTF16(name_)));
     37   ON_CALL(*this, ExpectingPinCode())
     38       .WillByDefault(testing::Return(false));
     39   ON_CALL(*this, ExpectingPasskey())
     40       .WillByDefault(testing::Return(false));
     41   ON_CALL(*this, ExpectingConfirmation())
     42       .WillByDefault(testing::Return(false));
     43   ON_CALL(*this, GetServices())
     44       .WillByDefault(testing::Return(service_list_));
     45 }
     46 
     47 MockBluetoothDevice::~MockBluetoothDevice() {}
     48 
     49 }  // namespace device
     50