Use test policy engine configuration file.
The test device may have configurable engine configuration file.
However, the test only load default engine. In that case, the test
should not use the configurable engine configuration file. Or it will
fail the test.
Bug: 360937480
Test: atest audiopolicy_tests
Flag: EXEMPT bugfix
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:274fed9f87c4d50eb9ea575a29bad24118f1156f)
Merged-In: Id3a553b2c4a2ea50e22fcff0f4163b7741c6713b
Change-Id: Id3a553b2c4a2ea50e22fcff0f4163b7741c6713b
diff --git a/services/audiopolicy/tests/audiopolicymanager_tests.cpp b/services/audiopolicy/tests/audiopolicymanager_tests.cpp
index f958ede..9445af1 100644
--- a/services/audiopolicy/tests/audiopolicymanager_tests.cpp
+++ b/services/audiopolicy/tests/audiopolicymanager_tests.cpp
@@ -223,12 +223,17 @@
std::unique_ptr<AudioPolicyTestManager> mManager;
constexpr static const uint32_t k48000SamplingRate = 48000;
+
+ static const std::string sTestEngineConfig;
};
+const std::string AudioPolicyManagerTest::sTestEngineConfig =
+ base::GetExecutableDirectory() + "/engine/test_audio_policy_engine_configuration.xml";
+
void AudioPolicyManagerTest::SetUp() {
mClient.reset(getClient());
ASSERT_NO_FATAL_FAILURE(SetUpManagerConfig()); // Subclasses may want to customize the config.
- mManager.reset(new AudioPolicyTestManager(mConfig, mClient.get()));
+ mManager.reset(new AudioPolicyTestManager(mConfig, mClient.get(), sTestEngineConfig));
ASSERT_EQ(NO_ERROR, mManager->initialize());
ASSERT_EQ(NO_ERROR, mManager->initCheck());
}