• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025-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 
16 #include <gtest/gtest.h>
17 #include "cJSON.h"
18 #include "interoperable_client_manager.h"
19 #include "call_object_manager.h"
20 #include "transmission_manager.h"
21 #include "interoperable_data_controller.h"
22 
23 namespace OHOS {
24 namespace Telephony {
25 using namespace testing::ext;
26 
27 class InteroperableClientManagerTest : public testing::Test {
28 public:
SetUpTestCase()29     static void SetUpTestCase() {}
TearDownTestCase()30     static void TearDownTestCase() {}
SetUp()31     virtual void SetUp() {}
TearDown()32     virtual void TearDown() {}
33 };
34 
35 /**
36  * @tc.number   Telephony_InteroperableClientManagerTest_001
37  * @tc.name     test create controller call
38  * @tc.desc     Function test
39  */
40 HWTEST_F(InteroperableClientManagerTest, Telephony_InteroperableClientManagerTest_001, Function | MediumTest | Level1)
41 {
42     auto controller = std::make_shared<InteroperableClientManager>();
43     sptr<CallBase> call = nullptr;
44     std::string devId = "";
45     ASSERT_NO_THROW(controller->OnCallCreated(call, devId));
46 }
47 
48 /**
49  * @tc.number   Telephony_InteroperableClientManagerTest_002
50  * @tc.name     test destroy call
51  * @tc.desc     Function test
52  */
53 HWTEST_F(InteroperableClientManagerTest, Telephony_InteroperableClientManagerTest_002, Function | MediumTest | Level1)
54 {
55     auto controller = std::make_shared<InteroperableClientManager>();
56     ASSERT_NO_THROW(controller->OnCallDestroyed());
57 }
58 
59 /**
60  * @tc.number   Telephony_InteroperableClientManagerTest_003
61  * @tc.name     test controller connect remote
62  * @tc.desc     Function test
63  */
64 HWTEST_F(InteroperableClientManagerTest, Telephony_InteroperableClientManagerTest_003, Function | MediumTest | Level1)
65 {
66     auto controller = std::make_shared<InteroperableClientManager>();
67     std::string devId = "";
68     ASSERT_NO_THROW(controller->ConnectRemote(devId));
69     ASSERT_NO_THROW(controller->ConnectRemote(devId)); // check session is not null
70 }
71 
72 } // namespace Telephony
73 } // namespace OHOS