• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 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 #ifndef FRAMEWORKS_INNERKITSIMPL_TEST_UNITTEST_MEDIALIBRARY_TEST_INCLUDE_MOCK_USB_TEST_H_
17 #define FRAMEWORKS_INNERKITSIMPL_TEST_UNITTEST_MEDIALIBRARY_TEST_INCLUDE_MOCK_USB_TEST_H_
18 
19 
20 #include "v1_0/iusbfn_mtp_interface.h"
21 
22 #include <gmock/gmock.h>
23 
24 namespace OHOS {
25 namespace Media {
26 class MockUsbfnMtpImpl : public HDI::Usb::Gadget::Mtp::V1_0::IUsbfnMtpInterface {
27 public:
28     MockUsbfnMtpImpl() = default;
29     virtual ~MockUsbfnMtpImpl() = default;
30 
31     int32_t Start() override;
32     int32_t Stop() override;
33     int32_t Read(std::vector<uint8_t> &data) override;
34     int32_t Write(const std::vector<uint8_t> &data) override;
35     int32_t ReceiveFile(const HDI::Usb::Gadget::Mtp::V1_0::UsbFnMtpFileSlice &mfs) override;
36     int32_t SendFile(const HDI::Usb::Gadget::Mtp::V1_0::UsbFnMtpFileSlice &mfs) override;
37     int32_t SendEvent(const std::vector<uint8_t> &eventData) override;
38 
39     int32_t Init() override;
40     int32_t Release() override;
41 };
42 } // namespace V1_0
43 } // namespace Mtp
44 
45 #endif // FRAMEWORKS_INNERKITSIMPL_TEST_UNITTEST_MEDIALIBRARY_TEST_INCLUDE_MOCK_USB_TEST_H_
46