#include "osi/include/osi.h"
#include "stack/btm/btm_int.h"
#include "stack/btm/btm_int_types.h"
+#include "stack/include/acl_hci_link_interface.h"
+#include "types/raw_address.h"
base::MessageLoop* get_main_message_loop() { return nullptr; }
std::map<std::string, int> mock_function_count_map;
+bool MOCK_bluetooth_shim_is_gd_acl_enabled_;
+
namespace {
using testing::_;
delete btm;
}
+TEST_F(StackBtmTest, InformBtmOnConnection) {
+ MOCK_bluetooth_shim_is_gd_acl_enabled_ = true;
+
+ btm_init();
+
+ RawAddress bda({0x11, 0x22, 0x33, 0x44, 0x55, 0x66});
+
+ btm_acl_connected(bda, 2, HCI_SUCCESS, false);
+ ASSERT_EQ(static_cast<size_t>(1),
+ mock_function_count_map.count("BTA_dm_acl_up"));
+
+ btm_free();
+}
+
} // namespace
#define UNUSED_ATTR
#endif
+extern bool MOCK_bluetooth_shim_is_gd_acl_enabled_;
+
bool bluetooth::shim::is_any_gd_enabled() {
mock_function_count_map[__func__]++;
return false;
}
bool bluetooth::shim::is_gd_acl_enabled() {
mock_function_count_map[__func__]++;
- return false;
+ return MOCK_bluetooth_shim_is_gd_acl_enabled_;
}
bool bluetooth::shim::is_gd_advertising_enabled() {
mock_function_count_map[__func__]++;