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

Side by Side Diff: device/bluetooth/test/bluetooth_test_mac.mm

Issue 1232613004: The first 3 BluetoothTest.* unit tests now running on Mac as well. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@movCBCM
Patch Set: Scheib's comments 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
(Empty)
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.
4
5 #include "device/bluetooth/bluetooth_adapter_mac.h"
6 #include "device/bluetooth/test/bluetooth_test_mac.h"
7 #include "device/bluetooth/test/mock_bluetooth_central_manager_mac.h"
8
9 namespace device {
10
11 BluetoothTestMac::BluetoothTestMac() {}
12
13 BluetoothTestMac::~BluetoothTestMac() {}
14
15 void BluetoothTestMac::SetUp() {}
16
17 void BluetoothTestMac::InitWithDefaultAdapter() {
18 adapter_ = BluetoothAdapterMac::CreateAdapter().get();
19 adapter_mac_ = static_cast<BluetoothAdapterMac*>(adapter_.get());
scheib 2015/07/19 19:41:44 Please change the type for CreateAdapter() too, so
krstnmnlsn 2015/07/20 18:11:24 Done.
20 }
21
22 void BluetoothTestMac::InitWithoutDefaultAdapter() {
23 adapter_mac_ = BluetoothAdapterMac::CreateAdapterForTest(
24 "", "", message_loop_.task_runner())
25 .get();
26 adapter_ = adapter_mac_;
27
28 if (BluetoothAdapterMac::IsLowEnergyAvailable()) {
29 id low_energy_central_manager = [[MockCentralManager alloc] init];
30 [low_energy_central_manager setState:CBCentralManagerStateUnsupported];
31 adapter_mac_->SetCentralManagerForTesting(low_energy_central_manager);
32 }
33 }
34
35 void BluetoothTestMac::InitWithFakeAdapter() {
36 adapter_mac_ =
37 BluetoothAdapterMac::CreateAdapterForTest(
38 kTestAdapterName, kTestAdapterAddress, message_loop_.task_runner())
39 .get();
40 adapter_ = adapter_mac_;
41
42 if (BluetoothAdapterMac::IsLowEnergyAvailable()) {
43 id low_energy_central_manager = [[MockCentralManager alloc] init];
44 [low_energy_central_manager setState:CBCentralManagerStatePoweredOn];
45 adapter_mac_->SetCentralManagerForTesting(low_energy_central_manager);
46 }
47 }
48
49 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/test/bluetooth_test_mac.h ('k') | device/bluetooth/test/mock_bluetooth_central_manager_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698