| Index: components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc
|
| diff --git a/components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc b/components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc
|
| index 29d35b8567811dd2e550f69d09259755ce21e465..31c2003f11bc35fd098912158c6d46f8184bcfb8 100644
|
| --- a/components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc
|
| +++ b/components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc
|
| @@ -328,59 +328,4 @@ TEST_F(ArcBluetoothBridgeTest, SingleAdvertisement) {
|
| EXPECT_EQ(0, NumActiveAdvertisements());
|
| }
|
|
|
| -// Invoke multi advertisement methods and make sure they are going down to the
|
| -// D-Bus clients.
|
| -TEST_F(ArcBluetoothBridgeTest, MultiAdvertisement) {
|
| - int32_t handle = ReserveAdvertisementHandle();
|
| - EXPECT_NE(kFailureAdvHandle, handle);
|
| - EXPECT_EQ(0, NumActiveAdvertisements());
|
| -
|
| - auto adv_data = base::MakeUnique<device::BluetoothAdvertisement::Data>(
|
| - device::BluetoothAdvertisement::ADVERTISEMENT_TYPE_BROADCAST);
|
| - mojom::BluetoothGattStatus status =
|
| - BroadcastAdvertisement(handle, std::move(adv_data));
|
| - EXPECT_EQ(mojom::BluetoothGattStatus::GATT_SUCCESS, status);
|
| - EXPECT_EQ(1, NumActiveAdvertisements());
|
| -
|
| - int32_t handle2 = ReserveAdvertisementHandle();
|
| - EXPECT_NE(kFailureAdvHandle, handle2);
|
| - auto adv_data2 = base::MakeUnique<device::BluetoothAdvertisement::Data>(
|
| - device::BluetoothAdvertisement::ADVERTISEMENT_TYPE_PERIPHERAL);
|
| - status = BroadcastAdvertisement(handle2, std::move(adv_data2));
|
| - EXPECT_EQ(mojom::BluetoothGattStatus::GATT_SUCCESS, status);
|
| - EXPECT_EQ(2, NumActiveAdvertisements());
|
| -
|
| - status = ReleaseAdvertisementHandle(handle);
|
| - EXPECT_EQ(mojom::BluetoothGattStatus::GATT_SUCCESS, status);
|
| - EXPECT_EQ(1, NumActiveAdvertisements());
|
| -
|
| - status = ReleaseAdvertisementHandle(handle2);
|
| - EXPECT_EQ(mojom::BluetoothGattStatus::GATT_SUCCESS, status);
|
| - EXPECT_EQ(0, NumActiveAdvertisements());
|
| -}
|
| -
|
| -// This tests that we support releasing reserved but unused handles.
|
| -// TODO(ejcaruso): When Chrome supports more handles, make sure we
|
| -// will stop reserving handles before we use all of Chrome's.
|
| -TEST_F(ArcBluetoothBridgeTest, ReleaseUnusedHandles) {
|
| - constexpr size_t kMaxBluezAdvertisements =
|
| - bluez::FakeBluetoothLEAdvertisingManagerClient::kMaxBluezAdvertisements;
|
| - std::vector<int32_t> reserved_handles;
|
| -
|
| - for (size_t i = 0; i < kMaxBluezAdvertisements; i++) {
|
| - int32_t handle = ReserveAdvertisementHandle();
|
| - if (handle == kFailureAdvHandle)
|
| - break;
|
| - reserved_handles.push_back(handle);
|
| - }
|
| - EXPECT_GT(reserved_handles.size(), 1Ul);
|
| - EXPECT_LE(reserved_handles.size(), kMaxBluezAdvertisements);
|
| - EXPECT_EQ(0, NumActiveAdvertisements());
|
| -
|
| - for (int32_t handle : reserved_handles) {
|
| - EXPECT_EQ(ReleaseAdvertisementHandle(handle),
|
| - mojom::BluetoothGattStatus::GATT_SUCCESS);
|
| - }
|
| -}
|
| -
|
| } // namespace arc
|
|
|