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

Side by Side Diff: base/debug/stack_trace_unittest.cc

Issue 2733323002: Changing multiprocess test SpawnChild to return a struct. (Closed)
Patch Set: Synced Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | base/files/file_locking_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include <stddef.h> 5 #include <stddef.h>
6 6
7 #include <limits> 7 #include <limits>
8 #include <sstream> 8 #include <sstream>
9 #include <string> 9 #include <string>
10 10
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 char* pointer = newArray(); 164 char* pointer = newArray();
165 delete pointer; 165 delete pointer;
166 return 2; 166 return 2;
167 } 167 }
168 168
169 // Regression test for StackDumpingSignalHandler async-signal unsafety. 169 // Regression test for StackDumpingSignalHandler async-signal unsafety.
170 // Combined with tcmalloc's debugallocation, that signal handler 170 // Combined with tcmalloc's debugallocation, that signal handler
171 // and e.g. mismatched new[]/delete would cause a hang because 171 // and e.g. mismatched new[]/delete would cause a hang because
172 // of re-entering malloc. 172 // of re-entering malloc.
173 TEST_F(StackTraceTest, AsyncSignalUnsafeSignalHandlerHang) { 173 TEST_F(StackTraceTest, AsyncSignalUnsafeSignalHandlerHang) {
174 Process child = SpawnChild("MismatchedMallocChildProcess"); 174 SpawnChildResult spawn_result = SpawnChild("MismatchedMallocChildProcess");
175 ASSERT_TRUE(child.IsValid()); 175 ASSERT_TRUE(spawn_result.process.IsValid());
176 int exit_code; 176 int exit_code;
177 ASSERT_TRUE(child.WaitForExitWithTimeout(TestTimeouts::action_timeout(), 177 ASSERT_TRUE(spawn_result.process.WaitForExitWithTimeout(
178 &exit_code)); 178 TestTimeouts::action_timeout(), &exit_code));
179 } 179 }
180 #endif // !defined(OS_IOS) 180 #endif // !defined(OS_IOS)
181 181
182 namespace { 182 namespace {
183 183
184 std::string itoa_r_wrapper(intptr_t i, size_t sz, int base, size_t padding) { 184 std::string itoa_r_wrapper(intptr_t i, size_t sz, int base, size_t padding) {
185 char buffer[1024]; 185 char buffer[1024];
186 CHECK_LE(sz, sizeof(buffer)); 186 CHECK_LE(sz, sizeof(buffer));
187 187
188 char* result = internal::itoa_r(i, buffer, sz, base, padding); 188 char* result = internal::itoa_r(i, buffer, sz, base, padding);
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 #endif 310 #endif
311 311
312 TEST_F(StackTraceTest, MAYBE_StackEnd) { 312 TEST_F(StackTraceTest, MAYBE_StackEnd) {
313 EXPECT_NE(0u, GetStackEnd()); 313 EXPECT_NE(0u, GetStackEnd());
314 } 314 }
315 315
316 #endif // HAVE_TRACE_STACK_FRAME_POINTERS 316 #endif // HAVE_TRACE_STACK_FRAME_POINTERS
317 317
318 } // namespace debug 318 } // namespace debug
319 } // namespace base 319 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/files/file_locking_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698