Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Unified Diff: test/win/child_launcher.h

Issue 1355503005: win: Make reading CrashpadInfo work across bitness (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: fixes Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « snapshot/win/pe_image_reader.cc ('k') | test/win/child_launcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/win/child_launcher.h
diff --git a/test/win/child_launcher.h b/test/win/child_launcher.h
index eade8caa814860883bbad3d585ff51e86a9fd09b..456d969d17eba5d78bd3b81fbfac35f6a617f97c 100644
--- a/test/win/child_launcher.h
+++ b/test/win/child_launcher.h
@@ -26,7 +26,8 @@ namespace test {
//! \brief Creates a child process for testing. Uses gtest `ASSERT_*` to
//! indicate failure. The child's output is passed through a pipe and is
-//! available via stdout_read_handle().
+//! available via stdout_read_handle(), and the child's input is attached to
+//! a second pipe available via stdin_write_handle().
class ChildLauncher {
public:
//! \brief Creates the object. \a executable will be escaped and prepended to
@@ -40,6 +41,11 @@ class ChildLauncher {
//! will be valid.
void Start();
+ //! \brief Waits for the child process to exit.
+ //!
+ //! \return The process exit code.
+ DWORD WaitForExit();
+
//! \brief The child process's `HANDLE`.
HANDLE process_handle() const { return process_handle_.get(); }
@@ -49,12 +55,16 @@ class ChildLauncher {
//! \brief The read end of a pipe attached to the child's stdout.
HANDLE stdout_read_handle() const { return stdout_read_handle_.get(); }
+ //! \brief The write end of a pipe attached to the child's stdin.
+ HANDLE stdin_write_handle() const { return stdin_write_handle_.get(); }
+
private:
std::wstring executable_;
std::wstring command_line_;
ScopedKernelHANDLE process_handle_;
ScopedKernelHANDLE main_thread_handle_;
ScopedFileHANDLE stdout_read_handle_;
+ ScopedFileHANDLE stdin_write_handle_;
};
//! \brief Utility function for building escaped command lines.
« no previous file with comments | « snapshot/win/pe_image_reader.cc ('k') | test/win/child_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698