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 "device/bluetooth/test/bluetooth_test.h"
8 #include "base/logging.h"
9 #include "base/run_loop.h"
10 #include "device/bluetooth/bluetooth_adapter.h"
14 const std::string
BluetoothTestBase::kTestAdapterName
= "FakeBluetoothAdapter";
15 const std::string
BluetoothTestBase::kTestAdapterAddress
= "A1:B2:C3:D4:E5:F6";
17 const std::string
BluetoothTestBase::kTestDeviceName
= "FakeBluetoothDevice";
18 const std::string
BluetoothTestBase::kTestDeviceNameEmpty
= "";
20 const std::string
BluetoothTestBase::kTestDeviceAddress1
= "01:00:00:90:1E:BE";
21 const std::string
BluetoothTestBase::kTestDeviceAddress2
= "02:00:00:8B:74:63";
23 const std::string
BluetoothTestBase::kTestUUIDGenericAccess
= "1800";
24 const std::string
BluetoothTestBase::kTestUUIDGenericAttribute
= "1801";
25 const std::string
BluetoothTestBase::kTestUUIDImmediateAlert
= "1802";
26 const std::string
BluetoothTestBase::kTestUUIDLinkLoss
= "1803";
28 BluetoothTestBase::BluetoothTestBase() {
31 BluetoothTestBase::~BluetoothTestBase() {
34 void BluetoothTestBase::Callback() {
38 void BluetoothTestBase::DiscoverySessionCallback(
39 scoped_ptr
<BluetoothDiscoverySession
> discovery_session
) {
41 discovery_sessions_
.push_back(discovery_session
.release());
44 void BluetoothTestBase::ErrorCallback() {
45 ++error_callback_count_
;
48 base::Closure
BluetoothTestBase::GetCallback() {
49 return base::Bind(&BluetoothTestBase::Callback
, base::Unretained(this));
52 BluetoothAdapter::DiscoverySessionCallback
53 BluetoothTestBase::GetDiscoverySessionCallback() {
54 return base::Bind(&BluetoothTestBase::DiscoverySessionCallback
,
55 base::Unretained(this));
58 BluetoothAdapter::ErrorCallback
BluetoothTestBase::GetErrorCallback() {
59 return base::Bind(&BluetoothTestBase::ErrorCallback
, base::Unretained(this));