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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 ::signal(SIGSEGV, SIG_DFL); | 227 ::signal(SIGSEGV, SIG_DFL); |
228 #endif | 228 #endif |
229 // Make this process have a segmentation fault. | 229 // Make this process have a segmentation fault. |
230 volatile int* oops = NULL; | 230 volatile int* oops = NULL; |
231 *oops = 0xDEAD; | 231 *oops = 0xDEAD; |
232 return 1; | 232 return 1; |
233 } | 233 } |
234 | 234 |
235 // This test intentionally crashes, so we don't need to run it under | 235 // This test intentionally crashes, so we don't need to run it under |
236 // AddressSanitizer. | 236 // AddressSanitizer. |
237 // TODO(jschuh): crbug.com/175753 Fix this in Win64 bots. | 237 #if defined(ADDRESS_SANITIZER) || defined(SYZYASAN) |
238 #if defined(ADDRESS_SANITIZER) || \ | |
239 (defined(OS_WIN) && defined(ARCH_CPU_X86_64)) || defined(SYZYASAN) | |
240 #define MAYBE_GetTerminationStatusCrash DISABLED_GetTerminationStatusCrash | 238 #define MAYBE_GetTerminationStatusCrash DISABLED_GetTerminationStatusCrash |
241 #else | 239 #else |
242 #define MAYBE_GetTerminationStatusCrash GetTerminationStatusCrash | 240 #define MAYBE_GetTerminationStatusCrash GetTerminationStatusCrash |
243 #endif | 241 #endif |
244 TEST_F(ProcessUtilTest, MAYBE_GetTerminationStatusCrash) { | 242 TEST_F(ProcessUtilTest, MAYBE_GetTerminationStatusCrash) { |
245 const std::string signal_file = | 243 const std::string signal_file = |
246 ProcessUtilTest::GetSignalFilePath(kSignalFileCrash); | 244 ProcessUtilTest::GetSignalFilePath(kSignalFileCrash); |
247 remove(signal_file.c_str()); | 245 remove(signal_file.c_str()); |
248 base::ProcessHandle handle = SpawnChild("CrashingChildProcess"); | 246 base::ProcessHandle handle = SpawnChild("CrashingChildProcess"); |
249 ASSERT_NE(base::kNullProcessHandle, handle); | 247 ASSERT_NE(base::kNullProcessHandle, handle); |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 // Check that process was really killed. | 840 // Check that process was really killed. |
843 EXPECT_TRUE(IsProcessDead(child_process)); | 841 EXPECT_TRUE(IsProcessDead(child_process)); |
844 base::CloseProcessHandle(child_process); | 842 base::CloseProcessHandle(child_process); |
845 } | 843 } |
846 | 844 |
847 MULTIPROCESS_TEST_MAIN(process_util_test_die_immediately) { | 845 MULTIPROCESS_TEST_MAIN(process_util_test_die_immediately) { |
848 return 0; | 846 return 0; |
849 } | 847 } |
850 | 848 |
851 #endif // defined(OS_POSIX) | 849 #endif // defined(OS_POSIX) |
OLD | NEW |