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

Commit 0e06a63c authored by Myles Watson's avatar Myles Watson
Browse files

Bluetooth: Remove credit check from Loopback tests

The Bluetooth specification doesn't require data credits
to come back within a specific timeframe, so the VTS test
can not require it.

Bug: 65269854
Test: VtsHalBlueoothV1_0TargetTest with simulated chip (no credits)
Change-Id: If2fc052d3b5236f6a3097f3d5403882226561404
parent a3b0f1f4
Loading
Loading
Loading
Loading
+27 −18
Original line number Diff line number Diff line
@@ -464,8 +464,9 @@ void BluetoothHidlTest::sendAndCheckACL(int num_packets, size_t size,

// Return the number of completed packets reported by the controller.
int BluetoothHidlTest::wait_for_completed_packets_event(uint16_t handle) {
    EXPECT_TRUE(bluetooth_cb->WaitForCallback(kCallbackNameHciEventReceived)
                    .no_timeout);
    if (!bluetooth_cb->WaitForCallback(kCallbackNameHciEventReceived).no_timeout) {
        ALOGW("%s: WaitForCallback timed out.", __func__);
    }
    int packets_processed = 0;
    while (event_queue.size() > 0) {
        hidl_vec<uint8_t> event = event_queue.front();
@@ -604,20 +605,24 @@ TEST_F(BluetoothHidlTest, LoopbackModeSinglePackets) {

  // This should work, but breaks on some current platforms.  Figure out how to
  // grandfather older devices but test new ones.
  int sco_packets_sent = 0;
  if (0 && sco_connection_handles.size() > 0) {
    sendAndCheckSCO(1, max_sco_data_packet_length, sco_connection_handles[0]);
    sco_packets_sent = 1;
    EXPECT_EQ(sco_packets_sent,
              wait_for_completed_packets_event(sco_connection_handles[0]));
    int sco_packets_sent = 1;
    int completed_packets = wait_for_completed_packets_event(sco_connection_handles[0]);
    if (sco_packets_sent != completed_packets) {
        ALOGW("%s: packets_sent (%d) != completed_packets (%d)", __func__, sco_packets_sent,
              completed_packets);
    }
  }

  int acl_packets_sent = 0;
  if (acl_connection_handles.size() > 0) {
    sendAndCheckACL(1, max_acl_data_packet_length, acl_connection_handles[0]);
    acl_packets_sent = 1;
    EXPECT_EQ(acl_packets_sent,
              wait_for_completed_packets_event(acl_connection_handles[0]));
    int acl_packets_sent = 1;
    int completed_packets = wait_for_completed_packets_event(acl_connection_handles[0]);
    if (acl_packets_sent != completed_packets) {
        ALOGW("%s: packets_sent (%d) != completed_packets (%d)", __func__, acl_packets_sent,
              completed_packets);
    }
  }
}

@@ -633,22 +638,26 @@ TEST_F(BluetoothHidlTest, LoopbackModeBandwidth) {

  // This should work, but breaks on some current platforms.  Figure out how to
  // grandfather older devices but test new ones.
  int sco_packets_sent = 0;
  if (0 && sco_connection_handles.size() > 0) {
    sendAndCheckSCO(NUM_SCO_PACKETS_BANDWIDTH, max_sco_data_packet_length,
                    sco_connection_handles[0]);
    sco_packets_sent = NUM_SCO_PACKETS_BANDWIDTH;
    EXPECT_EQ(sco_packets_sent,
              wait_for_completed_packets_event(sco_connection_handles[0]));
    int sco_packets_sent = NUM_SCO_PACKETS_BANDWIDTH;
    int completed_packets = wait_for_completed_packets_event(sco_connection_handles[0]);
    if (sco_packets_sent != completed_packets) {
        ALOGW("%s: packets_sent (%d) != completed_packets (%d)", __func__, sco_packets_sent,
              completed_packets);
    }
  }

  int acl_packets_sent = 0;
  if (acl_connection_handles.size() > 0) {
    sendAndCheckACL(NUM_ACL_PACKETS_BANDWIDTH, max_acl_data_packet_length,
                    acl_connection_handles[0]);
    acl_packets_sent = NUM_ACL_PACKETS_BANDWIDTH;
    EXPECT_EQ(acl_packets_sent,
              wait_for_completed_packets_event(acl_connection_handles[0]));
    int acl_packets_sent = NUM_ACL_PACKETS_BANDWIDTH;
    int completed_packets = wait_for_completed_packets_event(acl_connection_handles[0]);
    if (acl_packets_sent != completed_packets) {
        ALOGW("%s: packets_sent (%d) != completed_packets (%d)", __func__, acl_packets_sent,
              completed_packets);
    }
  }
}