From 566240ad7ac28b8fc8df8de0194b705bc9eb51ca Mon Sep 17 00:00:00 2001 From: Eddy-SH Chen Date: Wed, 13 Sep 2023 15:25:24 +0800 Subject: [PATCH] Add fix vts fail when configureMonitorEvent [Description] VTS StartFilterInDemux failed when configureMonitorEvent is called [Root Cause] Scrambling status event is not notified when configureMonitorEvent is called so test case failed. [Solution] Scrambling status event is not notified because of no input data. Add input setting and check event notified or not after data is input. Bug: 288193021 Change-Id: Icaaf0adc5bbd1c512742c48b0b665218da1c7980 --- tv/tuner/aidl/vts/functional/FilterTests.cpp | 7 ++++++- tv/tuner/aidl/vts/functional/FilterTests.h | 1 + tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tv/tuner/aidl/vts/functional/FilterTests.cpp b/tv/tuner/aidl/vts/functional/FilterTests.cpp index 53afef731a..533d0e6782 100644 --- a/tv/tuner/aidl/vts/functional/FilterTests.cpp +++ b/tv/tuner/aidl/vts/functional/FilterTests.cpp @@ -305,13 +305,18 @@ AssertionResult FilterTests::configureMonitorEvent(int64_t filterId, int32_t mon ndk::ScopedAStatus status; status = mFilters[filterId]->configureMonitorEvent(monitorEventTypes); + return AssertionResult(status.isOk()); +} + +AssertionResult FilterTests::testMonitorEvent(uint64_t filterId, uint32_t monitorEventTypes) { + EXPECT_TRUE(mFilterCallbacks[filterId]) << "Test with getNewlyOpenedFilterId first."; if (monitorEventTypes & static_cast(DemuxFilterMonitorEventType::SCRAMBLING_STATUS)) { mFilterCallbacks[filterId]->testFilterScramblingEvent(); } if (monitorEventTypes & static_cast(DemuxFilterMonitorEventType::IP_CID_CHANGE)) { mFilterCallbacks[filterId]->testFilterIpCidEvent(); } - return AssertionResult(status.isOk()); + return AssertionResult(true); } AssertionResult FilterTests::startIdTest(int64_t filterId) { diff --git a/tv/tuner/aidl/vts/functional/FilterTests.h b/tv/tuner/aidl/vts/functional/FilterTests.h index f579441d4f..f57093ebb4 100644 --- a/tv/tuner/aidl/vts/functional/FilterTests.h +++ b/tv/tuner/aidl/vts/functional/FilterTests.h @@ -124,6 +124,7 @@ class FilterTests { AssertionResult configAvFilterStreamType(AvStreamType type, int64_t filterId); AssertionResult configIpFilterCid(int32_t ipCid, int64_t filterId); AssertionResult configureMonitorEvent(int64_t filterId, int32_t monitorEventTypes); + AssertionResult testMonitorEvent(uint64_t filterId, uint32_t monitorEventTypes); AssertionResult getFilterMQDescriptor(int64_t filterId, bool getMqDesc); AssertionResult startFilter(int64_t filterId); AssertionResult stopFilter(int64_t filterId); diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp index 9db82c893d..3664b6cfdf 100644 --- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp +++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp @@ -60,6 +60,11 @@ void TunerFilterAidlTest::configSingleFilterInDemuxTest(FilterConfig filterConf, } ASSERT_TRUE(mFilterTests.getFilterMQDescriptor(filterId, filterConf.getMqDesc)); ASSERT_TRUE(mFilterTests.startFilter(filterId)); + ASSERT_TRUE(mFrontendTests.tuneFrontend(frontendConf, true /*testWithDemux*/)); + if (filterConf.monitorEventTypes > 0) { + ASSERT_TRUE(mFilterTests.testMonitorEvent(filterId, filterConf.monitorEventTypes)); + } + ASSERT_TRUE(mFrontendTests.stopTuneFrontend(true /*testWithDemux*/)); ASSERT_TRUE(mFilterTests.stopFilter(filterId)); ASSERT_TRUE(mFilterTests.closeFilter(filterId)); ASSERT_TRUE(mDemuxTests.closeDemux());