1 // 2 // Copyright (C) 2023 The Android Open Source Project 3 // 4 // Licensed under the Apache License, Version 2.0 (the "License"); 5 // you may not use this file except in compliance with the License. 6 // You may obtain a copy of the License at 7 // 8 // http://www.apache.org/licenses/LICENSE-2.0 9 // 10 // Unless required by applicable law or agreed to in writing, software 11 // distributed under the License is distributed on an "AS IS" BASIS, 12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 // See the License for the specific language governing permissions and 14 // limitations under the License. 15 // 16 #pragma once 17 18 #include <gmock/gmock.h> 19 #include "fastboot_driver_interface.h" 20 21 namespace fastboot { 22 23 class MockFastbootDriver : public IFastBootDriver { 24 public: 25 MOCK_METHOD(RetCode, FlashPartition, 26 (const std::string& partition, android::base::borrowed_fd fd, uint32_t sz), 27 (override)); 28 MOCK_METHOD(RetCode, DeletePartition, (const std::string&), (override)); 29 MOCK_METHOD(RetCode, Reboot, (std::string*, std::vector<std::string>*), (override)); 30 MOCK_METHOD(RetCode, RebootTo, (std::string, std::string*, std::vector<std::string>*), 31 (override)); 32 33 MOCK_METHOD(RetCode, GetVar, (const std::string&, std::string*, std::vector<std::string>*), 34 (override)); 35 36 MOCK_METHOD(RetCode, Download, 37 (const std::string&, android::base::borrowed_fd, size_t, std::string*, 38 std::vector<std::string>*), 39 (override)); 40 41 MOCK_METHOD(RetCode, RawCommand, 42 (const std::string&, const std::string&, std::string*, std::vector<std::string>*, 43 int*), 44 (override)); 45 MOCK_METHOD(RetCode, ResizePartition, (const std::string&, const std::string&), (override)); 46 MOCK_METHOD(RetCode, Erase, (const std::string&, std::string*, std::vector<std::string>*), 47 (override)); 48 MOCK_METHOD(RetCode, WaitForDisconnect, (), (override)); 49 }; 50 51 } // namespace fastboot