Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Side by Side Diff: device/bluetooth/test/bluetooth_test.cc

Issue 1150833002: bluetooth: android: Initial Low Energy Discovery Sessions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bta-manifest-
Patch Set: Add tests Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "device/bluetooth/test/bluetooth_test.h" 5 #include "device/bluetooth/test/bluetooth_test.h"
6 6
7 #include "base/bind.h"
8 #include "base/logging.h"
9 #include "base/run_loop.h"
10 #include "device/bluetooth/bluetooth_adapter.h"
11
7 namespace device { 12 namespace device {
8 13
9 BluetoothTestBase::BluetoothTestBase() { 14 BluetoothTestBase::BluetoothTestBase() {
10 } 15 }
11 16
12 BluetoothTestBase::~BluetoothTestBase() { 17 BluetoothTestBase::~BluetoothTestBase() {
13 } 18 }
14 19
20 void BluetoothTestBase::Callback() {
21 ++callback_count_;
22 }
23
24 void BluetoothTestBase::DiscoverySessionCallback(
25 scoped_ptr<BluetoothDiscoverySession> discovery_session) {
26 ++callback_count_;
27 discovery_sessions_.push_back(discovery_session.release());
28 }
29
30 void BluetoothTestBase::ErrorCallback() {
31 ++error_callback_count_;
32 }
33
34 base::Closure BluetoothTestBase::GetCallback() {
35 return base::Bind(&BluetoothTestBase::Callback, base::Unretained(this));
36 }
37
38 BluetoothAdapter::DiscoverySessionCallback
39 BluetoothTestBase::GetDiscoverySessionCallback() {
40 return base::Bind(&BluetoothTestBase::DiscoverySessionCallback,
41 base::Unretained(this));
42 }
43
44 BluetoothAdapter::ErrorCallback BluetoothTestBase::GetErrorCallback() {
45 return base::Bind(&BluetoothTestBase::ErrorCallback, base::Unretained(this));
46 }
47
15 } // namespace device 48 } // namespace device
OLDNEW
« device/bluetooth/bluetooth_adapter_unittest.cc ('K') | « device/bluetooth/test/bluetooth_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698