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 HPAE_AUDIO_AUDIO_SERVICE_CALLBACK_UNIT_TEST_H 16 #define HPAE_AUDIO_AUDIO_SERVICE_CALLBACK_UNIT_TEST_H 17 #include "audio_service_hpae_callback.h" 18 19 namespace OHOS { 20 namespace AudioStandard { 21 class HpaeAudioServiceCallbackUnitTest : public AudioServiceHpaeCallback { 22 public: 23 ~HpaeAudioServiceCallbackUnitTest() override; 24 25 void OnOpenAudioPortCb(int32_t portId) override; 26 27 void OnCloseAudioPortCb(int32_t result) override; 28 29 void OnReloadAudioPortCb(int32_t portId) override; 30 31 void OnSetSinkMuteCb(int32_t result) override; 32 33 void OnGetAllSinkInputsCb(int32_t result, std::vector<SinkInput> &sinkInputs) override; 34 35 void OnGetAllSourceOutputsCb(int32_t result, std::vector<SourceOutput> &sourceOutputs) override; 36 37 void OnGetAllSinksCb(int32_t result, std::vector<SinkInfo> &sinks) override; 38 39 void OnMoveSinkInputByIndexOrNameCb(int32_t result) override; 40 41 void OnMoveSourceOutputByIndexOrNameCb(int32_t result) override; 42 43 void OnSetSourceOutputMuteCb(int32_t result) override; 44 45 void OnGetAudioEffectPropertyCbV3(int32_t result) override; 46 47 void OnGetAudioEffectPropertyCb(int32_t result) override; 48 49 void OnGetAudioEnhancePropertyCbV3(int32_t result) override; 50 51 void OnGetAudioEnhancePropertyCb(int32_t result) override; 52 53 void HandleSourceAudioStreamRemoved(uint32_t sessionId) override; 54 55 int32_t GetPortId() const noexcept; 56 57 int32_t GetCloseAudioPortResult() const noexcept; 58 59 int32_t GetSetSinkMuteResult() const noexcept; 60 61 int32_t GetGetAllSinkInputsResult() const noexcept; 62 63 int32_t GetGetAllSourceOutputsResult() const noexcept; 64 65 int32_t GetGetAllSinksResult() const noexcept; 66 67 int32_t GetMoveSinkInputByIndexOrNameResult() const noexcept; 68 69 int32_t GetMoveSourceOutputByIndexOrNameResult() const noexcept; 70 71 int32_t GetSetSourceOutputMuteResult() const noexcept; 72 73 int32_t GetGetAudioEffectPropertyResult() const noexcept; 74 75 int32_t GetGetAudioEnhancePropertyResult() const noexcept; 76 77 std::vector<SinkInput> GetSinkInputs() const noexcept; 78 79 std::vector<SourceOutput> GetSourceOutputs() const noexcept; 80 81 std::vector<SinkInfo> GetSinks() const noexcept; 82 83 private: 84 int32_t portId_ = -1; 85 int32_t closeAudioPortResult_ = -1; 86 int32_t setSinkMuteResult_ = -1; 87 int32_t getAllSinkInputsResult_ = -1; 88 int32_t getAllSourceOutputsResult_ = -1; 89 int32_t getAllSinksResult_ = -1; 90 int32_t moveSinkInputByIndexOrNameResult_ = -1; 91 int32_t moveSourceOutputByIndexOrNameResult_ = -1; 92 int32_t setSourceOutputMuteResult_ = -1; 93 int32_t getAudioEffectPropertyResult_ = -1; 94 int32_t getAudioEnhancePropertyResult_ = -1; 95 std::vector<SinkInput> sinkInputs_; 96 std::vector<SourceOutput> sourceOutputs_; 97 std::vector<SinkInfo> sinks_; 98 }; 99 } // namespace AudioStandard 100 } // namespace OHOS 101 #endif