1 /* 2 * Copyright (C) 2021-2024 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 <string> 20 #include <vector> 21 #include "log_tags.h" 22 #include "test_service_proxy.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 bool ConnectService(); 35 bool StartSyncTransaction(); 36 bool StartPingService(); 37 bool StartGetFooService(); 38 bool StartLoopTest(int maxCount); 39 bool StartDumpService(); 40 bool StartTestFileDescriptor(); 41 bool StartAsyncDumpService(); 42 bool TestEnableSerialInvokeFlag(); 43 bool TestNativeIPCSendRequests(int subCmd); 44 bool TestRegisterRemoteStub(); 45 bool TestUnRegisterRemoteStub(); 46 bool TestSendTooManyRequest(); 47 bool TestMultiThreadSendRequest(); 48 bool TestQueryThreadInvocationState(); 49 50 private: 51 static constexpr HiviewDFX::HiLogLabel LABEL = { LOG_CORE, LOG_ID_TEST, "TestServiceClient" }; 52 sptr<ITestService> testService_; 53 std::shared_ptr<NativeRemoteStubTest> remoteStub_{ nullptr }; 54 }; 55 } // namespace OHOS 56 #endif // OHOS_IPC_TEST_SERVICE_CLIENT_H 57