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

Unified Diff: util/test/multiprocess_exec_test.cc

Issue 880763002: Reorganize Multiprocess and implement for Windows (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: fixes 2 Created 5 years, 11 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 | « util/test/multiprocess_exec_posix.cc ('k') | util/test/multiprocess_exec_test_child.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/test/multiprocess_exec_test.cc
diff --git a/util/test/multiprocess_exec_test.cc b/util/test/multiprocess_exec_test.cc
index 8fb1548f36e6e3168c006058f2d4cec0dbe09a58..d151d2b1f9cd4cd71d23feb8e0f66f1a3661d9fb 100644
--- a/util/test/multiprocess_exec_test.cc
+++ b/util/test/multiprocess_exec_test.cc
@@ -15,6 +15,8 @@
#include "util/test/multiprocess_exec.h"
#include "base/basictypes.h"
+#include "base/strings/utf_string_conversions.h"
+#include "build/build_config.h"
#include "gtest/gtest.h"
#include "util/file/file_io.h"
#include "util/test/executable_path.h"
@@ -31,13 +33,13 @@ class TestMultiprocessExec final : public MultiprocessExec {
private:
void MultiprocessParent() override {
- // Use Logging*FD() instead of Checked*FD() so that the test can fail
+ // Use Logging*File() instead of Checked*File() so that the test can fail
// gracefully with a gtest assertion if the child does not execute properly.
char c = 'z';
- ASSERT_TRUE(LoggingWriteFile(WritePipeFD(), &c, 1));
+ ASSERT_TRUE(LoggingWriteFile(WritePipeHandle(), &c, 1));
- ASSERT_TRUE(LoggingReadFile(ReadPipeFD(), &c, 1));
+ ASSERT_TRUE(LoggingReadFile(ReadPipeHandle(), &c, 1));
EXPECT_EQ('Z', c);
}
@@ -47,8 +49,16 @@ class TestMultiprocessExec final : public MultiprocessExec {
TEST(MultiprocessExec, MultiprocessExec) {
TestMultiprocessExec multiprocess_exec;
base::FilePath test_executable = ExecutablePath();
+#if defined(OS_POSIX)
+ std::string child_test_executable = test_executable.value();
+#elif defined(OS_WIN)
std::string child_test_executable =
- test_executable.value() + "_multiprocess_exec_test_child";
+ base::UTF16ToUTF8(test_executable.RemoveFinalExtension().value());
+#endif // OS_POSIX
+ child_test_executable += "_multiprocess_exec_test_child";
+#if defined(OS_WIN)
+ child_test_executable += ".exe";
+#endif
multiprocess_exec.SetChildCommand(child_test_executable, nullptr);
multiprocess_exec.Run();
}
« no previous file with comments | « util/test/multiprocess_exec_posix.cc ('k') | util/test/multiprocess_exec_test_child.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698