1 /* 2 * Copyright (c) 2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef PRO_AUDIO_SERVICE_ADAPTER_UNIT_TEST_H 16 #define PRO_AUDIO_SERVICE_ADAPTER_UNIT_TEST_H 17 #include <functional> 18 #include "gtest/gtest.h" 19 #include "pro_audio_service_adapter_impl.h" 20 namespace OHOS { 21 namespace AudioStandard { 22 class ProAudioServiceCallbackTest : public AudioServiceAdapterCallback { 23 public: ProAudioServiceCallbackTest()24 ProAudioServiceCallbackTest() {} ~ProAudioServiceCallbackTest()25 ~ProAudioServiceCallbackTest() 26 { 27 AUDIO_WARNING_LOG("Destructor ProAudioServiceCallbackTest"); 28 } OnAudioStreamRemoved(const uint64_t sessionId)29 void OnAudioStreamRemoved(const uint64_t sessionId) 30 {} OnSetVolumeDbCb()31 void OnSetVolumeDbCb() 32 {} 33 }; 34 35 class ProAudioServiceAdapterUnitTest : public testing::Test { 36 public: 37 ProAudioServiceAdapterUnitTest(); 38 ~ProAudioServiceAdapterUnitTest(); 39 static void SetUpTestCase(void); 40 static void TearDownTestCase(void); 41 void SetUp(void); 42 void TearDown(void); 43 AudioModuleInfo InitSinkAudioModeInfo(); 44 AudioModuleInfo InitSourceAudioModeInfo(); 45 private: 46 void Init(); 47 protected: 48 std::shared_ptr<AudioServiceAdapter> impl_; 49 int32_t engineFlag_; 50 }; 51 } // namespace AudioStandard 52 } // namespace OHOS 53 54 #endif 55