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 OHOS_IPC_TEST_SERVICE_CLIENT_H
17 #define OHOS_IPC_TEST_SERVICE_CLIENT_H
18 
19 #include <vector>
20 #include <string>
21 #include "test_service_skeleton.h"
22 #include "log_tags.h"
23 #include "test_capi_skeleton.h"
24 
25 namespace OHOS {
26 struct TraceParam {
27     int dataSize;
28     int testTimes;
29     int sleepUs;
30 };
31 
32 class TestServiceClient {
33 public:
34     int ConnectService();
35     void StartSyncTransaction();
36     void StartSyncDelayReply();
37     void StartAsyncTransaction();
38     void StartPingService();
39     void StartGetFooService();
40     int StartLoopTest(int maxCount);
41     void StartDumpService();
42     void StartTestFileDescriptor();
43     void StartAsyncDumpService();
44     void TestEnableSerialInvokeFlag();
45     void TestNativeIPCSendRequests(int subCmd);
46     void TestRegisterRemoteStub();
47     void TestUnRegisterRemoteStub();
48     void TestSendTooManyRequest();
49     void TestMultiThreadSendRequest();
50 
51 private:
52     static constexpr HiviewDFX::HiLogLabel LABEL = { LOG_CORE, LOG_ID_TEST, "TestServiceClient" };
53     sptr<ITestService> testService_;
54     std::shared_ptr<NativeRemoteStubTest> remoteStub_{ nullptr };
55 };
56 } // namespace OHOS
57 #endif // OHOS_IPC_TEST_SERVICE_CLIENT_H
58