1 /* 2 * Copyright (C) 2021 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 16 #ifndef TELEPHONY_CS_TEST_H 17 #define TELEPHONY_CS_TEST_H 18 19 #include "gtest/gtest.h" 20 21 #include "cellular_call_data_struct.h" 22 #include "cellular_call_interface.h" 23 24 namespace OHOS { 25 namespace Telephony { 26 class CsTest : public testing::Test { 27 public: 28 static void SetUpTestCase(); 29 static void TearDownTestCase(); 30 void SetUp(); 31 void TearDown(); 32 33 int32_t Dial(const sptr<CellularCallInterface> &telephonyService) const; 34 int32_t HangUp(const sptr<CellularCallInterface> &telephonyService) const; 35 int32_t Answer(const sptr<CellularCallInterface> &telephonyService) const; 36 int32_t Reject(const sptr<CellularCallInterface> &telephonyService) const; 37 int32_t HoldCall(const sptr<CellularCallInterface> &telephonyService) const; 38 int32_t UnHoldCall(const sptr<CellularCallInterface> &telephonyService) const; 39 int32_t SwitchCall(const sptr<CellularCallInterface> &telephonyService) const; 40 int32_t IsEmergencyPhoneNumber(const sptr<CellularCallInterface> &telephonyService) const; 41 int32_t CombineConference(const sptr<CellularCallInterface> &telephonyService) const; 42 int32_t SeparateConference(const sptr<CellularCallInterface> &telephonyService) const; 43 int32_t InviteToConference(const sptr<CellularCallInterface> &telephonyService) const; 44 int32_t KickOutFromConference(const sptr<CellularCallInterface> &telephonyService) const; 45 int32_t HangUpAllConnection(const sptr<CellularCallInterface> &telephonyService) const; 46 int32_t UpdateImsCallMode(const sptr<CellularCallInterface> &telephonyService) const; 47 int32_t RegisterCallBack(const sptr<CellularCallInterface> &telephonyService) const; 48 int32_t UnRegisterCallBack(const sptr<CellularCallInterface> &telephonyService) const; 49 int32_t StartDtmf(const sptr<CellularCallInterface> &telephonyService) const; 50 int32_t StopDtmf(const sptr<CellularCallInterface> &telephonyService) const; 51 int32_t SendDtmf(const sptr<CellularCallInterface> &telephonyService) const; 52 int32_t StartRtt(const sptr<CellularCallInterface> &telephonyService) const; 53 int32_t StopRtt(const sptr<CellularCallInterface> &telephonyService) const; 54 int32_t SetCallTransferInfo(const sptr<CellularCallInterface> &telephonyService) const; 55 int32_t GetCallTransferInfo(const sptr<CellularCallInterface> &telephonyService) const; 56 int32_t SetCallWaiting(const sptr<CellularCallInterface> &telephonyService) const; 57 int32_t GetCallWaiting(const sptr<CellularCallInterface> &telephonyService) const; 58 int32_t SetCallRestriction(const sptr<CellularCallInterface> &telephonyService) const; 59 int32_t GetCallRestriction(const sptr<CellularCallInterface> &telephonyService) const; 60 int32_t SetMute(const sptr<CellularCallInterface> &telephonyService) const; 61 int32_t GetMute(const sptr<CellularCallInterface> &telephonyService) const; 62 int32_t InputNumForInterface(const sptr<CellularCallInterface> &telephonyService) const; 63 64 private: 65 using RequestFuncType = int32_t (CsTest::*)(const sptr<CellularCallInterface> &telephonyService) const; 66 std::map<int32_t, RequestFuncType> requestFuncMap_; 67 }; 68 } // namespace Telephony 69 } // namespace OHOS 70 #endif // TELEPHONY_CS_TEST_H 71