1 /* 2 * Copyright (c) 2023 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 MOCK_I_CLOUD_DOWNLOAD_CALLBACK_H 17 #define MOCK_I_CLOUD_DOWNLOAD_CALLBACK_H 18 19 20 #include <gmock/gmock.h> 21 22 #include "i_cloud_download_callback.h" 23 #include "iremote_stub.h" 24 #include "dfs_error.h" 25 26 namespace OHOS::FileManagement::CloudSync { 27 28 class CloudDownloadCallbackMock : public IRemoteStub<ICloudDownloadCallback> { 29 public: 30 int code_; CloudDownloadCallbackMock()31 CloudDownloadCallbackMock() : code_(0) {} ~CloudDownloadCallbackMock()32 virtual ~CloudDownloadCallbackMock() {} 33 34 MOCK_METHOD4(SendRequest, int(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option)); 35 InvokeSendRequest(uint32_t code,MessageParcel & data,MessageParcel & reply,MessageOption & option)36 int32_t InvokeSendRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) 37 { 38 code_ = code; 39 return E_OK; 40 } 41 OnDownloadProcess(const DownloadProgressObj & progress)42 void OnDownloadProcess(const DownloadProgressObj& progress) override 43 {} 44 }; 45 46 } // namespace OHOS::FileManagement::CloudSync 47 48 #endif // MOCK_I_CLOUD_DOWNLOAD_CALLBACK_H