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

Unified Diff: device/bluetooth/test/bluetooth_test.h

Issue 2248913002: bluetooth: Implement RSSI and Tx Power on macOS and Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-refactor-adv-data
Patch Set: Clean up Created 4 years, 4 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.h
diff --git a/device/bluetooth/test/bluetooth_test.h b/device/bluetooth/test/bluetooth_test.h
index 90f7c7ca81f9e13897fa31888bf4f1b2dc5080ef..0eeb7749fafeb93a9ef205326f5d6f15361ca2d4 100644
--- a/device/bluetooth/test/bluetooth_test.h
+++ b/device/bluetooth/test/bluetooth_test.h
@@ -51,6 +51,15 @@ class BluetoothTestBase : public testing::Test {
static const std::string kTestDeviceAddress2;
static const std::string kTestDeviceAddress3;
+ enum { kTestRSSI1 = -81 };
+ enum { kTestRSSI2 = -61 };
+ enum { kTestRSSI3 = -41 };
+ enum { kTestRSSI4 = -21 };
+ enum { kTestRSSI5 = -1 };
+
+ enum { kTestTxPower1 = -40 };
+ enum { kTestTxPower2 = -20 };
+
static const std::string kTestUUIDGenericAccess;
static const std::string kTestUUIDGenericAttribute;
static const std::string kTestUUIDImmediateAlert;
@@ -95,20 +104,23 @@ class BluetoothTestBase : public testing::Test {
// Create a fake Low Energy device and discover it.
// |device_ordinal| selects between multiple fake device data sets to produce:
- // 1: kTestDeviceName with advertised UUIDs kTestUUIDGenericAccess,
- // kTestUUIDGenericAttribute, address kTestDeviceAddress1 and service
- // data of {kTestUUIDHeartRate: [1]}.
- // 2: kTestDeviceName with advertised UUIDs kTestUUIDImmediateAlert,
- // kTestUUIDLinkLoss, address kTestDeviceAddress1 and service data of
- // {kTestUUIDHeartRate: [2], kTestUUIDImmediateAlert: [0]}.
- // 3: kTestDeviceNameEmpty with no advertised UUIDs and address
- // kTestDeviceAddress1.
- // 4: kTestDeviceNameEmpty with no advertised UUIDs and address
- // kTestDeviceAddress2.
- // 5: Device with no name, with no advertised UUIDs and address
- // kTestDeviceAddress1.
- // 6: kTestDeviceName with no advertised UUIDs and address
- // kTestDeviceAddress2, but which also supports BR/EDR.
+ // 1: kTestDeviceName with address kTestDeviceAddress1, RSSI of kTestRSSI1,
Jeffrey Yasskin 2016/08/24 04:32:02 Could you write these as: // 1: Name: kTestDevi
ortuno 2016/08/24 21:29:09 Done.
+ // advertised UUIDs kTestUUIDGenericAccess, kTestUUIDGenericAttribute,
+ // service data of {kTestUUIDHeartRate: [1]} and a Tx Power of
+ // kTestTxPower1.
+ // 2: kTestDeviceName with address kTestDeviceAddress1, RSSI of kTestRSSI2,
+ // advertised UUIDs kTestUUIDImmediateAlert, kTestUUIDLinkLoss, service
+ // data of {kTestUUIDHeartRate: [2], kTestUUIDImmediateAlert: [0]} and
+ // Tx Power of kTestTxPower2.
+ // 3: kTestDeviceNameEmpty with address kTestDeviceAddress1, RSSI of
+ // kTestRSSI3, no advertised UUIDs, no service data, and no Tx Power.
+ // 4: kTestDeviceNameEmpty with address kTestDeviceAddress2, RSSI of
+ // kTestRSSI4, no advertised UUIDs, no service data and no Tx Power.
+ // 5: No name device with address kTestDeviceAddress1, RSSI of kTestRSSI5,
+ // no advertised UUIDs, no service data and no Tx Power.
+ // 6: kTestDeviceName with address kTestDeviceAddress2, RSSI of kTestRSSI1,
+ // no advertised UUIDs, no service data, no Tx Power but which also
+ // supports BR/EDR.
virtual BluetoothDevice* SimulateLowEnergyDevice(int device_ordinal);
// Create a fake classic device and discover it. The device will have

Powered by Google App Engine
This is Rietveld 408576698