OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium 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 #define _CRT_SECURE_NO_WARNINGS | 5 #define _CRT_SECURE_NO_WARNINGS |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/alias.h" | 10 #include "base/debug/alias.h" |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 base::LaunchOptions options; | 600 base::LaunchOptions options; |
601 options.wait = true; | 601 options.wait = true; |
602 options.environ = env_changes; | 602 options.environ = env_changes; |
603 options.clear_environ = clear_environ; | 603 options.clear_environ = clear_environ; |
604 options.fds_to_remap = &fds_to_remap; | 604 options.fds_to_remap = &fds_to_remap; |
605 #if defined(OS_LINUX) | 605 #if defined(OS_LINUX) |
606 options.clone_flags = clone_flags; | 606 options.clone_flags = clone_flags; |
607 #else | 607 #else |
608 CHECK_EQ(0, clone_flags); | 608 CHECK_EQ(0, clone_flags); |
609 #endif // OS_LINUX | 609 #endif // OS_LINUX |
610 EXPECT_TRUE(base::LaunchProcess(args, options, NULL)); | 610 EXPECT_TRUE(base::LaunchProcess(args, options).IsValid()); |
611 PCHECK(IGNORE_EINTR(close(fds[1])) == 0); | 611 PCHECK(IGNORE_EINTR(close(fds[1])) == 0); |
612 | 612 |
613 char buf[512]; | 613 char buf[512]; |
614 const ssize_t n = HANDLE_EINTR(read(fds[0], buf, sizeof(buf))); | 614 const ssize_t n = HANDLE_EINTR(read(fds[0], buf, sizeof(buf))); |
615 | 615 |
616 PCHECK(IGNORE_EINTR(close(fds[0])) == 0); | 616 PCHECK(IGNORE_EINTR(close(fds[0])) == 0); |
617 | 617 |
618 return std::string(buf, n); | 618 return std::string(buf, n); |
619 } | 619 } |
620 | 620 |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 | 907 |
908 // Check that process was really killed. | 908 // Check that process was really killed. |
909 EXPECT_TRUE(IsProcessDead(child_process.Handle())); | 909 EXPECT_TRUE(IsProcessDead(child_process.Handle())); |
910 } | 910 } |
911 | 911 |
912 MULTIPROCESS_TEST_MAIN(process_util_test_die_immediately) { | 912 MULTIPROCESS_TEST_MAIN(process_util_test_die_immediately) { |
913 return 0; | 913 return 0; |
914 } | 914 } |
915 | 915 |
916 #endif // defined(OS_POSIX) | 916 #endif // defined(OS_POSIX) |
OLD | NEW |