Crashpad
|
Manages a Mach-aware multiprocess test. More...
#include "test/mac/mach_multiprocess.h"
Public Member Functions | |
void | Run () |
Public Member Functions inherited from crashpad::test::Multiprocess | |
void | Run () |
Runs the test. More... | |
void | SetExpectedChildTermination (TerminationReason reason, ReturnCodeType code) |
Sets the expected termination reason and code. More... | |
void | SetExpectedChildTerminationBuiltinTrap () |
Sets termination reason and code appropriately for a child that terminates via __builtin_trap() . | |
Protected Member Functions | |
void | PreFork () override |
Establishes the proper testing environment prior to forking. More... | |
mach_port_t | LocalPort () const |
Returns a receive right for the local port. More... | |
mach_port_t | RemotePort () const |
Returns a send right for the remote port. More... | |
task_t | ChildTask () const |
Returns a send right for the child’s task port. More... | |
Protected Member Functions inherited from crashpad::test::Multiprocess | |
pid_t | ChildPID () const |
Returns the child process’ process ID. More... | |
FileHandle | ReadPipeHandle () const |
Returns the read pipe’s file handle. More... | |
FileHandle | WritePipeHandle () const |
Returns the write pipe’s file handle. More... | |
void | CloseReadPipe () |
Closes the read pipe. More... | |
void | CloseWritePipe () |
Closes the write pipe. More... | |
void | set_info (internal::MultiprocessInfo *info) |
internal::MultiprocessInfo * | info () |
Additional Inherited Members | |
Public Types inherited from crashpad::test::Multiprocess | |
enum | TerminationReason : bool |
The termination type for a child process. More... | |
Manages a Mach-aware multiprocess test.
This is similar to the base Multiprocess test, but adds Mach features. The parent process has access to the child process’ task port. The parent and child processes are able to communicate via Mach IPC: each process has a receive right to its “local port” and a send right to a “remote port”, and messages sent to the remote port in one process can be received on the local port in the partner process.
Subclasses are expected to implement the parent and child by overriding the appropriate methods.
|
protected |
Returns a send right for the child’s task port.
This method may only be called by the parent process.
|
protected |
Returns a receive right for the local port.
This method may be called by either the parent or the child process. It returns a receive right, with a corresponding send right held in the opposing process.
|
overrideprotectedvirtual |
Establishes the proper testing environment prior to forking.
Subclasses that solely implement a test should not need to override this method. Subclasses that do not implement tests but instead implement additional testing features on top of this class may override this method provided that they call the superclass’ implementation first as follows:
Subclass implementations may signal failure by raising their own fatal gtest assertions.
Reimplemented from crashpad::test::Multiprocess.
|
protected |
Returns a send right for the remote port.
This method may be called by either the parent or the child process. It returns a send right, with the corresponding receive right held in the opposing process.