Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0088cb9b authored by Chris Manton's avatar Chris Manton
Browse files

net_test_btif_stack: Add default_btrc_ctrl_callbacks

Bug: 312991808
Test: atest net_test_btif_stack

Change-Id: I48cc517912f7293c5dc7b2d50234f43a45680b55
parent fb04368a
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -223,10 +223,11 @@ struct rc_feature_cb_t {
static std::promise<rc_connection_state_cb_t> g_btrc_connection_state_promise;
static std::promise<rc_feature_cb_t> g_btrc_feature;

class BtifRcFeatureTest : public BtifRcTest {
class BtifRcWithCallbacksTest : public BtifRcTest {
 protected:
  void SetUp() override {
    BtifRcTest::SetUp();
    btrc_ctrl_callbacks = default_btrc_ctrl_callbacks;
    init_ctrl(&btrc_ctrl_callbacks);
    jni_thread.StartUp();
    btrc_ctrl_callbacks.getrcfeatures_cb = [](const RawAddress& bd_addr,
@@ -243,11 +244,12 @@ class BtifRcFeatureTest : public BtifRcTest {
    jni_thread.ShutDown();
    bt_rc_ctrl_callbacks->getrcfeatures_cb = [](const RawAddress& bd_addr,
                                                int features) {};
    btrc_ctrl_callbacks = default_btrc_ctrl_callbacks;
    BtifRcTest::TearDown();
  }
};

TEST_F(BtifRcFeatureTest, handle_rc_ctrl_features) {
TEST_F(BtifRcWithCallbacksTest, handle_rc_ctrl_features) {
  g_btrc_feature = std::promise<rc_feature_cb_t>();
  std::future<rc_feature_cb_t> future = g_btrc_feature.get_future();
  btif_rc_device_cb_t p_dev;