<trclass="memitem:adedaaa5fbbb57de1ae5af8ef7c84b4bf"><tdclass="memItemLeft"align="right"valign="top">enum  </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classcrashpad_1_1test_1_1Multiprocess.html#adedaaa5fbbb57de1ae5af8ef7c84b4bf">TerminationReason</a> : bool <trclass="memdesc:adedaaa5fbbb57de1ae5af8ef7c84b4bf"><tdclass="mdescLeft"> </td><tdclass="mdescRight">The termination type for a child process. <ahref="classcrashpad_1_1test_1_1Multiprocess.html#adedaaa5fbbb57de1ae5af8ef7c84b4bf">More...</a><br/></td></tr>
<trclass="memdesc:a801aa7a78b2254c31c3ef7e0b24208e3"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Runs the test. <ahref="#a801aa7a78b2254c31c3ef7e0b24208e3">More...</a><br/></td></tr>
<trclass="memitem:a619dd6b1fd2a909df6f3d6b2e1c75ad2"><tdclass="memItemLeft"align="right"valign="top">void </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="classcrashpad_1_1test_1_1Multiprocess.html#a619dd6b1fd2a909df6f3d6b2e1c75ad2">SetExpectedChildTermination</a> (<aclass="el"href="classcrashpad_1_1test_1_1Multiprocess.html#adedaaa5fbbb57de1ae5af8ef7c84b4bf">TerminationReason</a> reason, int code)</td></tr>
<trclass="memdesc:a619dd6b1fd2a909df6f3d6b2e1c75ad2"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the expected termination reason and code. <ahref="#a619dd6b1fd2a909df6f3d6b2e1c75ad2">More...</a><br/></td></tr>
<trclass="memdesc:a122d18401346cf600a4f6ab63d83c8ca"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Establishes the proper testing environment prior to forking. <ahref="#a122d18401346cf600a4f6ab63d83c8ca">More...</a><br/></td></tr>
<trclass="memdesc:a89ec1079c25eca71250ff3ccf8ec2b72"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Closes the read pipe. <ahref="#a89ec1079c25eca71250ff3ccf8ec2b72">More...</a><br/></td></tr>
<trclass="memdesc:a9d7a2037501f89d4d8aa3099285b7ae9"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Closes the write pipe. <ahref="#a9d7a2037501f89d4d8aa3099285b7ae9">More...</a><br/></td></tr>
<divclass="textblock"><p>Manages a multiprocess test. </p>
<p>These tests are <code>fork()</code>-based. The parent and child processes are able to communicate via a pair of POSIX pipes.</p>
<p>Subclasses are expected to implement the parent and child by overriding the appropriate methods.</p>
<p>On Windows, this class is only an internal implementation detail of <aclass="el"href="classcrashpad_1_1test_1_1MultiprocessExec.html"title="Manages an exec()-based multiprocess test. ">MultiprocessExec</a> and all tests must use that class. </p>
<p>A normal return happens when a test returns from RunChild(), or for tests that <code>exec()</code>, returns from <code>main()</code>. This also happens for tests that call <code>exit()</code> or <code>_exit()</code>. </p>
<p>This method may be called by either the parent or the child process. An attempt to write to the write pipe in the partner process will fail with <code>EPIPE</code> or <code>SIGPIPE</code>. <aclass="el"href="classcrashpad_1_1test_1_1Multiprocess.html#a208b33d3006abfd8e024430c510aa117"title="Returns the read pipe’s file handle. ">ReadPipeHandle()</a> must not be called after this. </p>
<p>This method may be called by either the parent or the child process. An attempt to read from the read pipe in the partner process will indicate end-of-file. <aclass="el"href="classcrashpad_1_1test_1_1Multiprocess.html#ab1ecd18814f4be49eedfe1dc076e1500"title="Returns the write pipe’s file handle. ">WritePipeHandle()</a> must not be called after this. </p>
<p>Establishes the proper testing environment prior to forking. </p>
<p>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:</p>
<divclass="fragment"><divclass="line"><spanclass="keywordtype">void</span><aclass="code"href="classcrashpad_1_1test_1_1Multiprocess.html#a122d18401346cf600a4f6ab63d83c8ca">PreFork</a>()<spanclass="keyword"> override </span>{</div><divclass="line"> ASSERT_NO_FATAL_FAILURE(<aclass="code"href="classcrashpad_1_1test_1_1Multiprocess.html#a122d18401346cf600a4f6ab63d83c8ca">Multiprocess::PreFork</a>());</div><divclass="line"></div><divclass="line"><spanclass="comment">// Place subclass-specific pre-fork code here.</span></div><divclass="line">}</div></div><!-- fragment --><p>Subclass implementations may signal failure by raising their own fatal gtest assertions. </p>
<p>Reimplemented in <aclass="el"href="classcrashpad_1_1test_1_1MultiprocessExec.html#a4fbe35bfe7dd75624b417c435ae2208b">crashpad::test::MultiprocessExec</a>, and <aclass="el"href="classcrashpad_1_1test_1_1MachMultiprocess.html#aac4af4a4c943686538069de230fe7abe">crashpad::test::MachMultiprocess</a>.</p>
<p>This method may be called by either the parent or the child process. Anything written to the write pipe in the partner process will appear on this file handle in this process.</p>
<p>It is an error to call this after <aclass="el"href="classcrashpad_1_1test_1_1Multiprocess.html#a89ec1079c25eca71250ff3ccf8ec2b72"title="Closes the read pipe. ">CloseReadPipe()</a> has been called.</p>
<p>This method establishes the proper testing environment by calling <aclass="el"href="classcrashpad_1_1test_1_1Multiprocess.html#a122d18401346cf600a4f6ab63d83c8ca"title="Establishes the proper testing environment prior to forking. ">PreFork()</a>, then calls <code>fork()</code>. In the parent process, it calls RunParent(), and in the child process, it calls RunChild().</p>
<p>This method uses gtest assertions to validate the testing environment. If the testing environment cannot be set up properly, it is possible that MultiprocessParent() or MultiprocessChild() will not be called. In the parent process, this method also waits for the child process to exit after MultiprocessParent() returns, and verifies that it exited in accordance with the expectations set by <aclass="el"href="classcrashpad_1_1test_1_1Multiprocess.html#a619dd6b1fd2a909df6f3d6b2e1c75ad2"title="Sets the expected termination reason and code. ">SetExpectedChildTermination()</a>. </p>
<p>Sets the expected termination reason and code. </p>
<p>The default expected termination reasaon is TerminationReason::kTerminationNormal, and the default expected termination code is <code>EXIT_SUCCESS</code> (<code>0</code>).</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">reason</td><td>Whether to expect the child to terminate normally or as a result of a signal. </td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">code</td><td>If <em>reason</em> is TerminationReason::kTerminationNormal, this is the expected exit status of the child. If <em>reason</em> is TerminationReason::kTerminationSignal, this is the signal that is expected to kill the child. </td></tr>
<p>This method may be called by either the parent or the child process. Anything written to this file handle in this process will appear on the read pipe in the partner process.</p>
<p>It is an error to call this after <aclass="el"href="classcrashpad_1_1test_1_1Multiprocess.html#a9d7a2037501f89d4d8aa3099285b7ae9"title="Closes the write pipe. ">CloseWritePipe()</a> has been called.</p>