| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // Options mock class | 5 // Options mock class |
| 6 #ifndef __CHROMEOS_OPTIONS_MOCK_OPTIONS_H | 6 #ifndef __CHROMEOS_OPTIONS_MOCK_OPTIONS_H |
| 7 #define __CHROMEOS_OPTIONS_MOCK_OPTIONS_H | 7 #define __CHROMEOS_OPTIONS_MOCK_OPTIONS_H |
| 8 | 8 |
| 9 #include "options.h" | 9 #include "options.h" |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 MOCK_METHOD1(set_env, void(Env *)); | 22 MOCK_METHOD1(set_env, void(Env *)); |
| 23 MOCK_METHOD1(set_executable_path, void(const char*)); | 23 MOCK_METHOD1(set_executable_path, void(const char*)); |
| 24 MOCK_CONST_METHOD0(executable_path, const char *()); | 24 MOCK_CONST_METHOD0(executable_path, const char *()); |
| 25 MOCK_METHOD2(set_arguments, void(char * const *, int)); | 25 MOCK_METHOD2(set_arguments, void(char * const *, int)); |
| 26 MOCK_CONST_METHOD0(arguments, char * const *()); | 26 MOCK_CONST_METHOD0(arguments, char * const *()); |
| 27 MOCK_CONST_METHOD0(argument_count, int()); | 27 MOCK_CONST_METHOD0(argument_count, int()); |
| 28 MOCK_METHOD1(set_environment, void(char * const *)); | 28 MOCK_METHOD1(set_environment, void(char * const *)); |
| 29 MOCK_CONST_METHOD0(environment, char * const *()); | 29 MOCK_CONST_METHOD0(environment, char * const *()); |
| 30 | 30 |
| 31 MOCK_METHOD1(set_add_readonly_mounts, void(bool)); | 31 MOCK_METHOD1(set_add_readonly_mounts, void(bool)); |
| 32 MOCK_METHOD1(set_caps_bitmask, void(uint64)); |
| 32 MOCK_METHOD1(set_disable_tracing, void(bool)); | 33 MOCK_METHOD1(set_disable_tracing, void(bool)); |
| 33 MOCK_METHOD1(set_enforce_syscalls_benchmark, void(bool)); | 34 MOCK_METHOD1(set_enforce_syscalls_benchmark, void(bool)); |
| 34 MOCK_METHOD1(set_enforce_syscalls_by_source, void(bool)); | 35 MOCK_METHOD1(set_enforce_syscalls_by_source, void(bool)); |
| 35 MOCK_METHOD1(set_gid, void(gid_t)); | 36 MOCK_METHOD1(set_gid, void(gid_t)); |
| 36 MOCK_METHOD1(set_namespace_vfs, void(bool)); | 37 MOCK_METHOD1(set_namespace_vfs, void(bool)); |
| 37 MOCK_METHOD1(set_namespace_pid, void(bool)); | 38 MOCK_METHOD1(set_namespace_pid, void(bool)); |
| 38 MOCK_METHOD1(set_sanitize_environment, void(bool)); | 39 MOCK_METHOD1(set_sanitize_environment, void(bool)); |
| 39 MOCK_METHOD1(set_uid, void(uid_t)); | 40 MOCK_METHOD1(set_uid, void(uid_t)); |
| 40 MOCK_METHOD1(set_use_capabilities, void(bool)); | 41 MOCK_METHOD1(set_use_capabilities, void(bool)); |
| 41 | 42 |
| 42 MOCK_CONST_METHOD0(add_readonly_mounts, bool()); | 43 MOCK_CONST_METHOD0(add_readonly_mounts, bool()); |
| 44 MOCK_CONST_METHOD0(caps_bitmask, uint64()); |
| 43 MOCK_CONST_METHOD0(disable_tracing, bool()); | 45 MOCK_CONST_METHOD0(disable_tracing, bool()); |
| 44 MOCK_CONST_METHOD0(enforce_syscalls_benchmark, bool()); | 46 MOCK_CONST_METHOD0(enforce_syscalls_benchmark, bool()); |
| 45 MOCK_CONST_METHOD0(enforce_syscalls_by_source, bool()); | 47 MOCK_CONST_METHOD0(enforce_syscalls_by_source, bool()); |
| 46 MOCK_CONST_METHOD0(gid, gid_t()); | 48 MOCK_CONST_METHOD0(gid, gid_t()); |
| 47 MOCK_CONST_METHOD0(namespace_vfs, bool()); | 49 MOCK_CONST_METHOD0(namespace_vfs, bool()); |
| 48 MOCK_CONST_METHOD0(namespace_pid, bool()); | 50 MOCK_CONST_METHOD0(namespace_pid, bool()); |
| 49 MOCK_CONST_METHOD0(sanitize_environment, bool()); | 51 MOCK_CONST_METHOD0(sanitize_environment, bool()); |
| 50 MOCK_CONST_METHOD0(uid, uid_t()); | 52 MOCK_CONST_METHOD0(uid, uid_t()); |
| 51 MOCK_CONST_METHOD0(use_capabilities, bool()); | 53 MOCK_CONST_METHOD0(use_capabilities, bool()); |
| 52 | 54 |
| 53 MOCK_CONST_METHOD0(change_uid, bool()); | 55 MOCK_CONST_METHOD0(change_uid, bool()); |
| 54 MOCK_CONST_METHOD0(change_gid, bool()); | 56 MOCK_CONST_METHOD0(change_gid, bool()); |
| 55 MOCK_METHOD0(FixUpDependencies, bool()); | 57 MOCK_METHOD0(FixUpDependencies, bool()); |
| 56 | 58 |
| 57 // Concrete call to the parent class fo easy self-testing of the | 59 // Concrete call to the parent class fo easy self-testing of the |
| 58 // default implementation. To use: | 60 // default implementation. To use: |
| 59 // EXPECT_CALL(*mockopt, FixUpDependencies()) | 61 // EXPECT_CALL(*mockopt, FixUpDependencies()) |
| 60 // .WillOnce(Invoke(mockopt, &MockOptions::OptionsFixUpDependencies)); | 62 // .WillOnce(Invoke(mockopt, &MockOptions::OptionsFixUpDependencies)); |
| 61 bool OptionsFixUpDependencies() { return Options::FixUpDependencies(); } | 63 bool OptionsFixUpDependencies() { return Options::FixUpDependencies(); } |
| 62 }; | 64 }; |
| 63 | 65 |
| 64 } // namespace minijail | 66 } // namespace minijail |
| 65 } // namespace chromeos | 67 } // namespace chromeos |
| 66 | 68 |
| 67 #endif // __CHROMEOS_OPTIONS_MOCK_OPTIONS_H | 69 #endif // __CHROMEOS_OPTIONS_MOCK_OPTIONS_H |
| OLD | NEW |