diff options
author | Myles Watson | 2017-09-06 18:26:49 -0500 |
---|---|---|
committer | Myles Watson | 2017-09-06 18:58:18 -0500 |
commit | 0e06a63c76f4c02ac307c6294f3d6f61ae6406e7 (patch) | |
tree | babe2bee3b70ba207f37be0372646ac2486395a9 | |
parent | a3b0f1f43142d204e4b3fe4d8c2aaf1caf4eafe2 (diff) | |
download | platform-hardware-interfaces-0e06a63c76f4c02ac307c6294f3d6f61ae6406e7.tar.gz platform-hardware-interfaces-0e06a63c76f4c02ac307c6294f3d6f61ae6406e7.tar.xz platform-hardware-interfaces-0e06a63c76f4c02ac307c6294f3d6f61ae6406e7.zip |
Bluetooth: Remove credit check from Loopback testsandroid-o-mr1-preview-2android-o-mr1-preview-1
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
-rw-r--r-- | bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp b/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp index fb53366c..6c9aa187 100644 --- a/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp +++ b/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp | |||
@@ -464,8 +464,9 @@ void BluetoothHidlTest::sendAndCheckACL(int num_packets, size_t size, | |||
464 | 464 | ||
465 | // Return the number of completed packets reported by the controller. | 465 | // Return the number of completed packets reported by the controller. |
466 | int BluetoothHidlTest::wait_for_completed_packets_event(uint16_t handle) { | 466 | int BluetoothHidlTest::wait_for_completed_packets_event(uint16_t handle) { |
467 | EXPECT_TRUE(bluetooth_cb->WaitForCallback(kCallbackNameHciEventReceived) | 467 | if (!bluetooth_cb->WaitForCallback(kCallbackNameHciEventReceived).no_timeout) { |
468 | .no_timeout); | 468 | ALOGW("%s: WaitForCallback timed out.", __func__); |
469 | } | ||
469 | int packets_processed = 0; | 470 | int packets_processed = 0; |
470 | while (event_queue.size() > 0) { | 471 | while (event_queue.size() > 0) { |
471 | hidl_vec<uint8_t> event = event_queue.front(); | 472 | hidl_vec<uint8_t> event = event_queue.front(); |
@@ -604,20 +605,24 @@ TEST_F(BluetoothHidlTest, LoopbackModeSinglePackets) { | |||
604 | 605 | ||
605 | // This should work, but breaks on some current platforms. Figure out how to | 606 | // This should work, but breaks on some current platforms. Figure out how to |
606 | // grandfather older devices but test new ones. | 607 | // grandfather older devices but test new ones. |
607 | int sco_packets_sent = 0; | ||
608 | if (0 && sco_connection_handles.size() > 0) { | 608 | if (0 && sco_connection_handles.size() > 0) { |
609 | sendAndCheckSCO(1, max_sco_data_packet_length, sco_connection_handles[0]); | 609 | sendAndCheckSCO(1, max_sco_data_packet_length, sco_connection_handles[0]); |
610 | sco_packets_sent = 1; | 610 | int sco_packets_sent = 1; |
611 | EXPECT_EQ(sco_packets_sent, | 611 | int completed_packets = wait_for_completed_packets_event(sco_connection_handles[0]); |
612 | wait_for_completed_packets_event(sco_connection_handles[0])); | 612 | if (sco_packets_sent != completed_packets) { |
613 | ALOGW("%s: packets_sent (%d) != completed_packets (%d)", __func__, sco_packets_sent, | ||
614 | completed_packets); | ||
615 | } | ||
613 | } | 616 | } |
614 | 617 | ||
615 | int acl_packets_sent = 0; | ||
616 | if (acl_connection_handles.size() > 0) { | 618 | if (acl_connection_handles.size() > 0) { |
617 | sendAndCheckACL(1, max_acl_data_packet_length, acl_connection_handles[0]); | 619 | sendAndCheckACL(1, max_acl_data_packet_length, acl_connection_handles[0]); |
618 | acl_packets_sent = 1; | 620 | int acl_packets_sent = 1; |
619 | EXPECT_EQ(acl_packets_sent, | 621 | int completed_packets = wait_for_completed_packets_event(acl_connection_handles[0]); |
620 | wait_for_completed_packets_event(acl_connection_handles[0])); | 622 | if (acl_packets_sent != completed_packets) { |
623 | ALOGW("%s: packets_sent (%d) != completed_packets (%d)", __func__, acl_packets_sent, | ||
624 | completed_packets); | ||
625 | } | ||
621 | } | 626 | } |
622 | } | 627 | } |
623 | 628 | ||
@@ -633,22 +638,26 @@ TEST_F(BluetoothHidlTest, LoopbackModeBandwidth) { | |||
633 | 638 | ||
634 | // This should work, but breaks on some current platforms. Figure out how to | 639 | // This should work, but breaks on some current platforms. Figure out how to |
635 | // grandfather older devices but test new ones. | 640 | // grandfather older devices but test new ones. |
636 | int sco_packets_sent = 0; | ||
637 | if (0 && sco_connection_handles.size() > 0) { | 641 | if (0 && sco_connection_handles.size() > 0) { |
638 | sendAndCheckSCO(NUM_SCO_PACKETS_BANDWIDTH, max_sco_data_packet_length, | 642 | sendAndCheckSCO(NUM_SCO_PACKETS_BANDWIDTH, max_sco_data_packet_length, |
639 | sco_connection_handles[0]); | 643 | sco_connection_handles[0]); |
640 | sco_packets_sent = NUM_SCO_PACKETS_BANDWIDTH; | 644 | int sco_packets_sent = NUM_SCO_PACKETS_BANDWIDTH; |
641 | EXPECT_EQ(sco_packets_sent, | 645 | int completed_packets = wait_for_completed_packets_event(sco_connection_handles[0]); |
642 | wait_for_completed_packets_event(sco_connection_handles[0])); | 646 | if (sco_packets_sent != completed_packets) { |
647 | ALOGW("%s: packets_sent (%d) != completed_packets (%d)", __func__, sco_packets_sent, | ||
648 | completed_packets); | ||
649 | } | ||
643 | } | 650 | } |
644 | 651 | ||
645 | int acl_packets_sent = 0; | ||
646 | if (acl_connection_handles.size() > 0) { | 652 | if (acl_connection_handles.size() > 0) { |
647 | sendAndCheckACL(NUM_ACL_PACKETS_BANDWIDTH, max_acl_data_packet_length, | 653 | sendAndCheckACL(NUM_ACL_PACKETS_BANDWIDTH, max_acl_data_packet_length, |
648 | acl_connection_handles[0]); | 654 | acl_connection_handles[0]); |
649 | acl_packets_sent = NUM_ACL_PACKETS_BANDWIDTH; | 655 | int acl_packets_sent = NUM_ACL_PACKETS_BANDWIDTH; |
650 | EXPECT_EQ(acl_packets_sent, | 656 | int completed_packets = wait_for_completed_packets_event(acl_connection_handles[0]); |
651 | wait_for_completed_packets_event(acl_connection_handles[0])); | 657 | if (acl_packets_sent != completed_packets) { |
658 | ALOGW("%s: packets_sent (%d) != completed_packets (%d)", __func__, acl_packets_sent, | ||
659 | completed_packets); | ||
660 | } | ||
652 | } | 661 | } |
653 | } | 662 | } |
654 | 663 | ||