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

Commit ff6b20c2 authored by Wei Wang's avatar Wei Wang Committed by YiHo Cheng
Browse files

Vts: thermal: Test notification with an unregistered local callback



Bug: 197935704
Test: /data/nativetest64/VtsHalThermalV2_0TargetTest/VtsHalThermalV2_0TargetTest
Signed-off-by: default avatarWei Wang <wvw@google.com>
Change-Id: Ida76565389d021b9433bfac8153408454f2bdee9
parent 89ec9c60
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -106,9 +106,10 @@ class ThermalHidlTest : public testing::TestWithParam<std::string> {
// Note: a real thermal throttling event from the Thermal HAL could be
// inadvertently received here.
TEST_P(ThermalHidlTest, NotifyThrottlingTest) {
    auto ret = mThermalCallback->notifyThrottling(kThrottleTemp);
    sp<ThermalCallback> thermalCallback = new (std::nothrow) ThermalCallback();
    auto ret = thermalCallback->notifyThrottling(kThrottleTemp);
    ASSERT_TRUE(ret.isOk());
    auto res = mThermalCallback->WaitForCallback(kCallbackNameNotifyThrottling);
    auto res = thermalCallback->WaitForCallback(kCallbackNameNotifyThrottling);
    EXPECT_TRUE(res.no_timeout);
    ASSERT_TRUE(res.args);
    EXPECT_EQ(kThrottleTemp, res.args->temperature);