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

Unified 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: comment edit 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 side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/test/bluetooth_test_mac.mm
diff --git a/device/bluetooth/test/bluetooth_test_mac.mm b/device/bluetooth/test/bluetooth_test_mac.mm
new file mode 100644
index 0000000000000000000000000000000000000000..3f9f72f833a7cb6a13cdbf6aed93c5268a8dfe59
--- /dev/null
+++ b/device/bluetooth/test/bluetooth_test_mac.mm
@@ -0,0 +1,49 @@
+// Copyright 2015 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 "device/bluetooth/bluetooth_adapter_mac.h"
+#include "device/bluetooth/test/bluetooth_test_mac.h"
+#include "device/bluetooth/test/mock_bluetooth_central_manager_mac.h"
+
+namespace device {
+
+BluetoothTestMac::BluetoothTestMac() {}
+
+BluetoothTestMac::~BluetoothTestMac() {}
+
+void BluetoothTestMac::SetUp() {}
+
+void BluetoothTestMac::InitWithDefaultAdapter() {
+ adapter_mac_ = BluetoothAdapterMac::CreateAdapter().get();
+ adapter_ = adapter_mac_;
+}
+
+void BluetoothTestMac::InitWithoutDefaultAdapter() {
+ adapter_mac_ = BluetoothAdapterMac::CreateAdapterForTest(
+ "", "", message_loop_.task_runner())
+ .get();
+ adapter_ = adapter_mac_;
+
+ if (BluetoothAdapterMac::IsLowEnergyAvailable()) {
+ id low_energy_central_manager = [[MockCentralManager alloc] init];
+ [low_energy_central_manager setState:CBCentralManagerStateUnsupported];
+ adapter_mac_->SetCentralManagerForTesting(low_energy_central_manager);
+ }
+}
+
+void BluetoothTestMac::InitWithFakeAdapter() {
+ adapter_mac_ =
+ BluetoothAdapterMac::CreateAdapterForTest(
+ kTestAdapterName, kTestAdapterAddress, message_loop_.task_runner())
+ .get();
+ adapter_ = adapter_mac_;
+
+ if (BluetoothAdapterMac::IsLowEnergyAvailable()) {
+ id low_energy_central_manager = [[MockCentralManager alloc] init];
+ [low_energy_central_manager setState:CBCentralManagerStatePoweredOn];
+ adapter_mac_->SetCentralManagerForTesting(low_energy_central_manager);
+ }
+}
+
+} // namespace device
« 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