Fix VTS issue of BroadcastRadio v2.0
1. This is a patch to fix a problem that occurs when running VTS on a system composed of multiple modules such as amfm and dab. In the case of dab, most of the OEM requirements do not include the seek function, so it may not be supported. Even if it is supported, a problem may occur because the test case for dab tune does not exist before the seek test case. 2. To correct this, a dab tune test case has been added to the VTS code, and in the case of a system that does not support dab seek, the seek test case has been modified to be processed as skip. Bug: 173174410 Signed-off-by : Hyewon Eum <hyewon.eum@lge.com> Change-Id: I28b1406a26fa66bcf972a6efd42ee76a55bae374
This commit is contained in:
parent
c0525521bb
commit
20eb57563b
1 changed files with 56 additions and 0 deletions
|
@ -483,6 +483,50 @@ TEST_F(BroadcastRadioHalTest, TuneFailsWithInvalid) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test tuning with DAB selector.
|
||||
*
|
||||
* Verifies that:
|
||||
* - if DAB selector is not supported, the method returns NOT_SUPPORTED;
|
||||
* - if it is supported, the method succeeds;
|
||||
* - after a successful tune call, onCurrentProgramInfoChanged callback is
|
||||
* invoked carrying a proper selector;
|
||||
* - program changes exactly to what was requested.
|
||||
*/
|
||||
TEST_F(BroadcastRadioHalTest, DabTune) {
|
||||
ASSERT_TRUE(openSession());
|
||||
|
||||
ProgramSelector sel = {};
|
||||
uint64_t freq = 178352;
|
||||
sel.primaryId = make_identifier(IdentifierType::DAB_FREQUENCY,freq);
|
||||
|
||||
std::this_thread::sleep_for(gTuneWorkaround);
|
||||
|
||||
// try tuning
|
||||
ProgramInfo infoCb = {};
|
||||
EXPECT_TIMEOUT_CALL(*mCallback, onCurrentProgramInfoChanged_,
|
||||
InfoHasId(utils::make_identifier(IdentifierType::DAB_FREQUENCY, freq)))
|
||||
.Times(AnyNumber())
|
||||
.WillOnce(DoAll(SaveArg<0>(&infoCb), testing::Return(ByMove(Void()))));
|
||||
auto result = mSession->tune(sel);
|
||||
|
||||
// expect a failure if it's not supported
|
||||
if (!utils::isSupported(mProperties, sel)) {
|
||||
EXPECT_EQ(Result::NOT_SUPPORTED, result);
|
||||
return;
|
||||
}
|
||||
|
||||
// expect a callback if it succeeds
|
||||
EXPECT_EQ(Result::OK, result);
|
||||
EXPECT_TIMEOUT_CALL_WAIT(*mCallback, onCurrentProgramInfoChanged_, timeout::tune);
|
||||
|
||||
LOG(DEBUG) << "current program info: " << toString(infoCb);
|
||||
|
||||
// it should tune exactly to what was requested
|
||||
auto freqs = utils::getAllIds(infoCb.selector, IdentifierType::DAB_FREQUENCY);
|
||||
EXPECT_NE(freqs.end(), find(freqs.begin(), freqs.end(), freq));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test tuning with empty program selector.
|
||||
*
|
||||
|
@ -514,6 +558,12 @@ TEST_F(BroadcastRadioHalTest, Seek) {
|
|||
|
||||
EXPECT_TIMEOUT_CALL(*mCallback, onCurrentProgramInfoChanged_, _).Times(AnyNumber());
|
||||
auto result = mSession->scan(true /* up */, true /* skip subchannel */);
|
||||
|
||||
if (result == Result::NOT_SUPPORTED) {
|
||||
printSkipped("seek not supported");
|
||||
return;
|
||||
}
|
||||
|
||||
EXPECT_EQ(Result::OK, result);
|
||||
EXPECT_TIMEOUT_CALL_WAIT(*mCallback, onCurrentProgramInfoChanged_, timeout::tune);
|
||||
|
||||
|
@ -563,6 +613,12 @@ TEST_F(BroadcastRadioHalTest, Cancel) {
|
|||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
auto result = mSession->scan(true /* up */, true /* skip subchannel */);
|
||||
|
||||
if (result == Result::NOT_SUPPORTED) {
|
||||
printSkipped("cancel is skipped because of seek not supported");
|
||||
return;
|
||||
}
|
||||
|
||||
ASSERT_EQ(Result::OK, result);
|
||||
|
||||
auto cancelResult = mSession->cancel();
|
||||
|
|
Loading…
Reference in a new issue