Index: device/bluetooth/bluetooth_adapter_mac_unittest.mm |
diff --git a/device/bluetooth/bluetooth_adapter_mac_unittest.mm b/device/bluetooth/bluetooth_adapter_mac_unittest.mm |
index 3e7ab6832ede2641ba91284e7597cdc009d3560b..1f0a8f94a9d94abf09e280b6ff22750b9ef18739 100644 |
--- a/device/bluetooth/bluetooth_adapter_mac_unittest.mm |
+++ b/device/bluetooth/bluetooth_adapter_mac_unittest.mm |
@@ -2,6 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+#include "base/mac/mac_util.h" |
#include "base/memory/ref_counted.h" |
#include "base/test/test_simple_task_runner.h" |
#include "device/bluetooth/bluetooth_adapter.h" |
@@ -25,9 +26,10 @@ class BluetoothAdapterMacTest : public testing::Test { |
// Helper methods for setup and access to BluetoothAdapterMacTest's members. |
bool SetMockCentralManager() { |
- Class aClass = NSClassFromString(@"CBCentralManager"); |
- if (aClass == nil) { |
- LOG(WARNING) << "CoreBluetooth not available, skipping unit test."; |
+ if (!base::mac::IsOSYosemiteOrLater()) { |
+ // For stability we only use CoreBluetooth on OS X >= 10.10. Thus on |
+ // previous OS X versions the code cannot be tested. |
+ LOG(WARNING) << "OS X version < 10.10, skipping unit test."; |
return false; |
} |
mock_central_manager_ = [[MockCentralManager alloc] init]; |