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

Side by Side Diff: device/bluetooth/bluetooth_device_unittest.cc

Issue 2706763002: bluetooth: Increase min api for Android (Closed)
Patch Set: bluetooth: Set min version to M Created 3 years, 10 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/bluetooth_device.h" 5 #include "device/bluetooth/bluetooth_device.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after
1250 LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test."; 1250 LOG(WARNING) << "Low Energy Bluetooth unavailable, skipping unit test.";
1251 return; 1251 return;
1252 } 1252 }
1253 InitWithFakeAdapter(); 1253 InitWithFakeAdapter();
1254 StartLowEnergyDiscoverySession(); 1254 StartLowEnergyDiscoverySession();
1255 BluetoothDevice* device = SimulateLowEnergyDevice(3); 1255 BluetoothDevice* device = SimulateLowEnergyDevice(3);
1256 device->CreateGattConnection(GetGattConnectionCallback(Call::EXPECTED), 1256 device->CreateGattConnection(GetGattConnectionCallback(Call::EXPECTED),
1257 GetConnectErrorCallback(Call::NOT_EXPECTED)); 1257 GetConnectErrorCallback(Call::NOT_EXPECTED));
1258 ResetEventCounts(); 1258 ResetEventCounts();
1259 SimulateGattConnection(device); 1259 SimulateGattConnection(device);
1260 EXPECT_EQ(1, gatt_discovery_attempts_); 1260 EXPECT_EQ(0, gatt_discovery_attempts_);
scheib 2017/04/08 04:05:34 Hmm, know why this changed?
ortuno 2017/04/08 04:07:43 Should've added a comment. This change just breaks
1261 1261
1262 SimulateGattDisconnection(device); 1262 SimulateGattDisconnection(device);
1263 1263
1264 SimulateGattServicesDiscoveryError(device); 1264 SimulateGattServicesDiscoveryError(device);
1265 EXPECT_FALSE(device->IsGattServicesDiscoveryComplete()); 1265 EXPECT_FALSE(device->IsGattServicesDiscoveryComplete());
1266 EXPECT_EQ(0u, device->GetGattServices().size()); 1266 EXPECT_EQ(0u, device->GetGattServices().size());
1267 } 1267 }
1268 #endif // defined(OS_ANDROID) || defined(OS_MACOSX) 1268 #endif // defined(OS_ANDROID) || defined(OS_MACOSX)
1269 1269
1270 #if defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_MACOSX) 1270 #if defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_MACOSX)
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
1332 1332
1333 BluetoothDevice* device2 = SimulateLowEnergyDevice(6); 1333 BluetoothDevice* device2 = SimulateLowEnergyDevice(6);
1334 EXPECT_EQ(BLUETOOTH_TRANSPORT_DUAL, device2->GetType()); 1334 EXPECT_EQ(BLUETOOTH_TRANSPORT_DUAL, device2->GetType());
1335 1335
1336 BluetoothDevice* device3 = SimulateClassicDevice(); 1336 BluetoothDevice* device3 = SimulateClassicDevice();
1337 EXPECT_EQ(BLUETOOTH_TRANSPORT_CLASSIC, device3->GetType()); 1337 EXPECT_EQ(BLUETOOTH_TRANSPORT_CLASSIC, device3->GetType());
1338 } 1338 }
1339 #endif // defined(OS_CHROMEOS) || defined(OS_LINUX) 1339 #endif // defined(OS_CHROMEOS) || defined(OS_LINUX)
1340 1340
1341 } // namespace device 1341 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698