OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/arc/bluetooth/arc_bluetooth_bridge.h" | 5 #include "components/arc/bluetooth/arc_bluetooth_bridge.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
15 #include "components/arc/arc_bridge_service.h" | 15 #include "components/arc/arc_bridge_service.h" |
16 #include "components/arc/bluetooth/bluetooth_type_converters.h" | 16 #include "components/arc/bluetooth/bluetooth_type_converters.h" |
17 #include "components/arc/common/bluetooth.mojom.h" | 17 #include "components/arc/common/bluetooth.mojom.h" |
18 #include "components/arc/test/fake_bluetooth_instance.h" | 18 #include "components/arc/test/fake_bluetooth_instance.h" |
19 #include "device/bluetooth/dbus/bluez_dbus_manager.h" | 19 #include "device/bluetooth/dbus/bluez_dbus_manager.h" |
20 #include "device/bluetooth/dbus/fake_bluetooth_adapter_client.h" | 20 #include "device/bluetooth/dbus/fake_bluetooth_adapter_client.h" |
21 #include "device/bluetooth/dbus/fake_bluetooth_device_client.h" | 21 #include "device/bluetooth/dbus/fake_bluetooth_device_client.h" |
22 #include "device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.h" | 22 #include "device/bluetooth/dbus/fake_bluetooth_gatt_characteristic_client.h" |
23 #include "device/bluetooth/dbus/fake_bluetooth_gatt_descriptor_client.h" | 23 #include "device/bluetooth/dbus/fake_bluetooth_gatt_descriptor_client.h" |
24 #include "device/bluetooth/dbus/fake_bluetooth_gatt_service_client.h" | 24 #include "device/bluetooth/dbus/fake_bluetooth_gatt_service_client.h" |
25 #include "device/bluetooth/dbus/fake_bluetooth_le_advertising_manager_client.h" | 25 #include "device/bluetooth/dbus/fake_bluetooth_le_advertising_manager_client.h" |
26 #include "mojo/public/cpp/bindings/array.h" | |
27 #include "testing/gtest/include/gtest/gtest.h" | 26 #include "testing/gtest/include/gtest/gtest.h" |
28 | 27 |
29 namespace { | 28 namespace { |
30 constexpr int16_t kTestRssi = -50; | 29 constexpr int16_t kTestRssi = -50; |
31 constexpr int16_t kTestRssi2 = -70; | 30 constexpr int16_t kTestRssi2 = -70; |
32 } | 31 } |
33 | 32 |
34 namespace arc { | 33 namespace arc { |
35 | 34 |
36 constexpr int kFailureAdvHandle = -1; | 35 constexpr int kFailureAdvHandle = -1; |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 BroadcastAdvertisement(handle, std::move(adv_data)); | 322 BroadcastAdvertisement(handle, std::move(adv_data)); |
324 EXPECT_EQ(mojom::BluetoothGattStatus::GATT_SUCCESS, status); | 323 EXPECT_EQ(mojom::BluetoothGattStatus::GATT_SUCCESS, status); |
325 EXPECT_EQ(1, NumActiveAdvertisements()); | 324 EXPECT_EQ(1, NumActiveAdvertisements()); |
326 | 325 |
327 status = ReleaseAdvertisementHandle(handle); | 326 status = ReleaseAdvertisementHandle(handle); |
328 EXPECT_EQ(mojom::BluetoothGattStatus::GATT_SUCCESS, status); | 327 EXPECT_EQ(mojom::BluetoothGattStatus::GATT_SUCCESS, status); |
329 EXPECT_EQ(0, NumActiveAdvertisements()); | 328 EXPECT_EQ(0, NumActiveAdvertisements()); |
330 } | 329 } |
331 | 330 |
332 } // namespace arc | 331 } // namespace arc |
OLD | NEW |