1 // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef LIBBRILLO_BRILLO_PROCESS_MOCK_H_ 6 #define LIBBRILLO_BRILLO_PROCESS_MOCK_H_ 7 8 #include <string> 9 10 #include <base/files/file_path.h> 11 #include <gmock/gmock.h> 12 13 #include "brillo/process.h" 14 15 namespace brillo { 16 17 class ProcessMock : public Process { 18 public: ProcessMock()19 ProcessMock() {} ~ProcessMock()20 virtual ~ProcessMock() {} 21 22 MOCK_METHOD(void, AddArg, (const std::string&), (override)); 23 MOCK_METHOD(void, RedirectInput, (const std::string&), (override)); 24 MOCK_METHOD(void, RedirectOutput, (const std::string&), (override)); 25 MOCK_METHOD(void, RedirectUsingPipe, (int, bool), (override)); 26 MOCK_METHOD(void, BindFd, (int, int), (override)); 27 MOCK_METHOD(void, SetUid, (uid_t), (override)); 28 MOCK_METHOD(void, SetGid, (gid_t), (override)); 29 MOCK_METHOD(void, SetCapabilities, (uint64_t), (override)); 30 MOCK_METHOD(void, ApplySyscallFilter, (const std::string&), (override)); 31 MOCK_METHOD(void, EnterNewPidNamespace, (), (override)); 32 MOCK_METHOD(void, SetInheritParentSignalMask, (bool), (override)); 33 MOCK_METHOD(void, SetPreExecCallback, (const PreExecCallback&), (override)); 34 MOCK_METHOD(void, SetSearchPath, (bool), (override)); 35 MOCK_METHOD(int, GetPipe, (int), (override)); 36 MOCK_METHOD(bool, Start, (), (override)); 37 MOCK_METHOD(int, Wait, (), (override)); 38 MOCK_METHOD(int, Run, (), (override)); 39 MOCK_METHOD(pid_t, pid, (), (override)); 40 MOCK_METHOD(bool, Kill, (int, int), (override)); 41 MOCK_METHOD(void, Reset, (pid_t), (override)); 42 MOCK_METHOD(bool, ResetPidByFile, (const std::string&), (override)); 43 MOCK_METHOD(pid_t, Release, (), (override)); 44 MOCK_METHOD(void, SetCloseUnusedFileDescriptors, (bool), (override)); 45 }; 46 47 } // namespace brillo 48 49 #endif // LIBBRILLO_BRILLO_PROCESS_MOCK_H_ 50