Merge "Test: Don't check results when no type-c ports" am: 7e9eece7b3
am: 8cf1bf3f00
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2583450 Change-Id: I9183098602a5efa17485cd8a30b981535617e29d Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
9912848327
1 changed files with 7 additions and 3 deletions
|
@ -95,6 +95,7 @@ class UsbCallback : public ::testing::VtsHalHidlTargetCallbackBase<UsbClientCall
|
||||||
Status retval) override {
|
Status retval) override {
|
||||||
UsbClientCallbackArgs arg;
|
UsbClientCallbackArgs arg;
|
||||||
if (retval == Status::SUCCESS) {
|
if (retval == Status::SUCCESS) {
|
||||||
|
arg.usb_last_port_status.status.portName = currentPortStatus[0].status.portName.c_str();
|
||||||
arg.usb_last_port_status.status.supportedModes =
|
arg.usb_last_port_status.status.supportedModes =
|
||||||
currentPortStatus[0].status.supportedModes;
|
currentPortStatus[0].status.supportedModes;
|
||||||
arg.usb_last_port_status.status.currentMode = currentPortStatus[0].status.currentMode;
|
arg.usb_last_port_status.status.currentMode = currentPortStatus[0].status.currentMode;
|
||||||
|
@ -165,9 +166,12 @@ TEST_P(UsbHidlTest, queryPortStatus) {
|
||||||
auto res = usb_cb_2->WaitForCallback(kCallbackNameNotifyPortStatusChange_1_1);
|
auto res = usb_cb_2->WaitForCallback(kCallbackNameNotifyPortStatusChange_1_1);
|
||||||
EXPECT_TRUE(res.no_timeout);
|
EXPECT_TRUE(res.no_timeout);
|
||||||
EXPECT_EQ(2, res.args->last_usb_cookie);
|
EXPECT_EQ(2, res.args->last_usb_cookie);
|
||||||
EXPECT_EQ(PortMode::NONE, res.args->usb_last_port_status.status.currentMode);
|
// if there are no type-c ports, skip below checks
|
||||||
EXPECT_EQ(PortMode::NONE, res.args->usb_last_port_status.status.supportedModes);
|
if (!res.args->usb_last_port_status.status.portName.empty()) {
|
||||||
EXPECT_EQ(Status::SUCCESS, res.args->usb_last_status);
|
EXPECT_EQ(PortMode::NONE, res.args->usb_last_port_status.status.currentMode);
|
||||||
|
EXPECT_EQ(PortMode::NONE, res.args->usb_last_port_status.status.supportedModes);
|
||||||
|
EXPECT_EQ(Status::SUCCESS, res.args->usb_last_status);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(UsbHidlTest);
|
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(UsbHidlTest);
|
||||||
INSTANTIATE_TEST_SUITE_P(
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
|
|
Loading…
Reference in a new issue