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

Unified Diff: components/arc/bluetooth/arc_bluetooth_bridge_unittest.cc

Issue 2438373002: arc: bluetooth: Set advertisement max slot to 1 (Closed)
Patch Set: remove unit test Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/arc/bluetooth/arc_bluetooth_bridge.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
elijahtaylor1 2016/10/22 04:04:56 For future reference, you could have done the foll
- 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
« no previous file with comments | « components/arc/bluetooth/arc_bluetooth_bridge.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698