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

Side by Side Diff: device/bluetooth/test/bluetooth_test.h

Issue 1412023002: bluetooth: mac: Only test Low Energy discovery sessions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@btm-key-strings-
Patch Set: Created 5 years, 2 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 2015 The Chromium Authors. All rights reserved. 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 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 #ifndef DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ 5 #ifndef DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_
6 #define DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ 6 #define DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 25 matching lines...) Expand all
36 static const std::string kTestDeviceAddress2; 36 static const std::string kTestDeviceAddress2;
37 37
38 static const std::string kTestUUIDGenericAccess; 38 static const std::string kTestUUIDGenericAccess;
39 static const std::string kTestUUIDGenericAttribute; 39 static const std::string kTestUUIDGenericAttribute;
40 static const std::string kTestUUIDImmediateAlert; 40 static const std::string kTestUUIDImmediateAlert;
41 static const std::string kTestUUIDLinkLoss; 41 static const std::string kTestUUIDLinkLoss;
42 42
43 BluetoothTestBase(); 43 BluetoothTestBase();
44 ~BluetoothTestBase() override; 44 ~BluetoothTestBase() override;
45 45
46 // Calls adapter_->StartDiscoverySession with this fixture's callbacks, and 46 // Calls adapter_->StartDiscoverySessionWithFilter with Low Energy transport,
47 // then RunLoop().RunUntilIdle(). 47 // and this fixture's callbacks. Then RunLoop().RunUntilIdle().
48 void StartDiscoverySession(); 48 void StartLowEnergyDiscoverySession();
49 49
50 // Check if Low Energy is available. On Mac, we require OS X >= 10.10. 50 // Check if Low Energy is available. On Mac, we require OS X >= 10.10.
51 virtual bool PlatformSupportsLowEnergy() = 0; 51 virtual bool PlatformSupportsLowEnergy() = 0;
52 52
53 // Initializes the BluetoothAdapter |adapter_| with the system adapter. 53 // Initializes the BluetoothAdapter |adapter_| with the system adapter.
54 virtual void InitWithDefaultAdapter(){}; 54 virtual void InitWithDefaultAdapter(){};
55 55
56 // Initializes the BluetoothAdapter |adapter_| with the system adapter forced 56 // Initializes the BluetoothAdapter |adapter_| with the system adapter forced
57 // to be ignored as if it did not exist. This enables tests for when an 57 // to be ignored as if it did not exist. This enables tests for when an
58 // adapter is not present on the system. 58 // adapter is not present on the system.
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 int error_callback_count_ = 0; 127 int error_callback_count_ = 0;
128 int gatt_connection_attempts_ = 0; 128 int gatt_connection_attempts_ = 0;
129 int gatt_disconnection_attempts_ = 0; 129 int gatt_disconnection_attempts_ = 0;
130 int gatt_discovery_attempts_ = 0; 130 int gatt_discovery_attempts_ = 0;
131 base::WeakPtrFactory<BluetoothTestBase> weak_factory_; 131 base::WeakPtrFactory<BluetoothTestBase> weak_factory_;
132 }; 132 };
133 133
134 } // namespace device 134 } // namespace device
135 135
136 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ 136 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698