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

Side by Side Diff: components/proximity_auth/bluetooth_connection_finder_unittest.cc

Issue 2808353004: bluetooth: Rename Is*Available to Is*Supported (Closed)
Patch Set: Add const Created 3 years, 8 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 "components/proximity_auth/bluetooth_connection_finder.h" 5 #include "components/proximity_auth/bluetooth_connection_finder.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 // should not crash. 194 // should not crash.
195 BluetoothConnectionFinder connection_finder( 195 BluetoothConnectionFinder connection_finder(
196 cryptauth::CreateClassicRemoteDeviceForTest(), 196 cryptauth::CreateClassicRemoteDeviceForTest(),
197 device::BluetoothUUID(kUuid), base::TimeDelta::FromMilliseconds(1)); 197 device::BluetoothUUID(kUuid), base::TimeDelta::FromMilliseconds(1));
198 } 198 }
199 199
200 TEST_F(ProximityAuthBluetoothConnectionFinderTest, Find_NoBluetoothAdapter) { 200 TEST_F(ProximityAuthBluetoothConnectionFinderTest, Find_NoBluetoothAdapter) {
201 // Some platforms do not support Bluetooth. This test is only meaningful on 201 // Some platforms do not support Bluetooth. This test is only meaningful on
202 // those platforms. 202 // those platforms.
203 adapter_ = NULL; 203 adapter_ = NULL;
204 if (device::BluetoothAdapterFactory::IsBluetoothAdapterAvailable()) 204 if (device::BluetoothAdapterFactory::IsBluetoothSupported())
205 return; 205 return;
206 206
207 // The StrictMock will verify that no connection is created. 207 // The StrictMock will verify that no connection is created.
208 StartConnectionFinder(false); 208 StartConnectionFinder(false);
209 } 209 }
210 210
211 TEST_F(ProximityAuthBluetoothConnectionFinderTest, 211 TEST_F(ProximityAuthBluetoothConnectionFinderTest,
212 Find_BluetoothAdapterNotPresent) { 212 Find_BluetoothAdapterNotPresent) {
213 // The StrictMock will verify that no connection is created. 213 // The StrictMock will verify that no connection is created.
214 ON_CALL(*adapter_, IsPresent()).WillByDefault(Return(false)); 214 ON_CALL(*adapter_, IsPresent()).WillByDefault(Return(false));
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 359
360 // Successfully connect to the Bluetooth device. 360 // Successfully connect to the Bluetooth device.
361 ON_CALL(*adapter_, GetDevice(cryptauth::kTestRemoteDeviceBluetoothAddress)) 361 ON_CALL(*adapter_, GetDevice(cryptauth::kTestRemoteDeviceBluetoothAddress))
362 .WillByDefault(Return(bluetooth_device_.get())); 362 .WillByDefault(Return(bluetooth_device_.get()));
363 MockConnection* connection = connection_finder_.ExpectCreateConnection(); 363 MockConnection* connection = connection_finder_.ExpectCreateConnection();
364 connection_finder_.seek_callback().Run(); 364 connection_finder_.seek_callback().Run();
365 SimulateDeviceConnection(connection); 365 SimulateDeviceConnection(connection);
366 } 366 }
367 367
368 } // namespace proximity_auth 368 } // namespace proximity_auth
OLDNEW
« no previous file with comments | « components/proximity_auth/bluetooth_connection_finder.cc ('k') | components/proximity_auth/bluetooth_connection_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698