| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/eintr_wrapper.h" | 10 #include "base/eintr_wrapper.h" |
| (...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 output.clear(); | 732 output.clear(); |
| 733 EXPECT_TRUE(base::GetAppOutputRestricted(CommandLine(argv), &output, 15)); | 733 EXPECT_TRUE(base::GetAppOutputRestricted(CommandLine(argv), &output, 15)); |
| 734 EXPECT_STREQ("123456789\n", output.c_str()); | 734 EXPECT_STREQ("123456789\n", output.c_str()); |
| 735 | 735 |
| 736 // Zero space allowed. | 736 // Zero space allowed. |
| 737 output = "abc"; | 737 output = "abc"; |
| 738 EXPECT_TRUE(base::GetAppOutputRestricted(CommandLine(argv), &output, 0)); | 738 EXPECT_TRUE(base::GetAppOutputRestricted(CommandLine(argv), &output, 0)); |
| 739 EXPECT_STREQ("", output.c_str()); | 739 EXPECT_STREQ("", output.c_str()); |
| 740 } | 740 } |
| 741 | 741 |
| 742 #if !(OS_MACOSX) | 742 #if !defined(OS_MACOSX) && !defined(OS_OPENBSD) |
| 743 // TODO(benwells): GetAppOutputRestricted should terminate applications | 743 // TODO(benwells): GetAppOutputRestricted should terminate applications |
| 744 // with SIGPIPE when we have enough output. http://crbug.com/88502 | 744 // with SIGPIPE when we have enough output. http://crbug.com/88502 |
| 745 TEST_F(ProcessUtilTest, GetAppOutputRestrictedSIGPIPE) { | 745 TEST_F(ProcessUtilTest, GetAppOutputRestrictedSIGPIPE) { |
| 746 std::vector<std::string> argv; | 746 std::vector<std::string> argv; |
| 747 std::string output; | 747 std::string output; |
| 748 | 748 |
| 749 argv.push_back(std::string(kShellPath)); // argv[0] | 749 argv.push_back(std::string(kShellPath)); // argv[0] |
| 750 argv.push_back("-c"); | 750 argv.push_back("-c"); |
| 751 #if defined(OS_ANDROID) | 751 #if defined(OS_ANDROID) |
| 752 argv.push_back("while echo 12345678901234567890; do :; done"); | 752 argv.push_back("while echo 12345678901234567890; do :; done"); |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 while ((value_ = base::AllocatePsychoticallyBigObjCObject())) {} | 1076 while ((value_ = base::AllocatePsychoticallyBigObjCObject())) {} |
| 1077 }, ""); | 1077 }, ""); |
| 1078 } | 1078 } |
| 1079 | 1079 |
| 1080 #endif // !ARCH_CPU_64_BITS | 1080 #endif // !ARCH_CPU_64_BITS |
| 1081 #endif // OS_MACOSX | 1081 #endif // OS_MACOSX |
| 1082 | 1082 |
| 1083 #endif // !defined(OS_ANDROID) | 1083 #endif // !defined(OS_ANDROID) |
| 1084 | 1084 |
| 1085 #endif // !defined(OS_WIN) | 1085 #endif // !defined(OS_WIN) |
| OLD | NEW |