1 /* 2 * Copyright (c) 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 FILE_ACCESS_SERVICE_MOCK_H 17 #define FILE_ACCESS_SERVICE_MOCK_H 18 19 #include "file_access_service_stub.h" 20 21 namespace OHOS { 22 namespace FileAccessFwk { 23 using Uri = OHOS::Uri; 24 class FileAccessServiceMock : public FileAccessServiceStub { 25 public: 26 MOCK_METHOD2(OnChange, int32_t(Uri uri, NotifyType notifyType)); 27 MOCK_METHOD4(RegisterNotify, int32_t(Uri uri, bool notifyForDescendants, 28 const sptr<IFileAccessObserver> &observer, const std::shared_ptr<ConnectExtensionInfo> &info)); 29 MOCK_METHOD3(UnregisterNotify, int32_t(Uri uri, const sptr<IFileAccessObserver> &observer, 30 const std::shared_ptr<ConnectExtensionInfo> &info)); 31 MOCK_METHOD2(GetExtensionProxy, int32_t(const std::shared_ptr<ConnectExtensionInfo> &info, 32 sptr<IFileAccessExtBase> &extensionProxy)); 33 MOCK_METHOD0(AsObject, sptr<IRemoteObject>()); 34 MOCK_METHOD2(CleanAllNotify, int32_t(Uri uri, const std::shared_ptr<ConnectExtensionInfo> &info)); 35 MOCK_METHOD4(OnRemoteRequest, int32_t(uint32_t code, MessageParcel &data, MessageParcel &reply, 36 MessageOption &option)); 37 MOCK_METHOD4(SendRequest, int(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option)); 38 MOCK_METHOD2(ConnectFileExtAbility, int32_t(const AAFwk::Want &want, 39 const sptr<AAFwk::IAbilityConnection>& connection)); 40 MOCK_METHOD1(DisConnectFileExtAbility, int32_t(const sptr<AAFwk::IAbilityConnection>& connection)); 41 }; 42 } // namespace FileAccessFwk 43 } // namespace OHOS 44 #endif // FILE_ACCESS_SERVICE_MOCK_H