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

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

Issue 16770006: Implement basic stack traces on Android and reenable unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: refactor symbolize Created 7 years, 6 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 | Annotate | Revision Log
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 <limits> 5 #include <limits>
6 #include <sstream> 6 #include <sstream>
7 #include <string> 7 #include <string>
8 8
9 #include "base/debug/stack_trace.h" 9 #include "base/debug/stack_trace.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 // The test is used for manual testing, e.g., to see the raw output. 120 // The test is used for manual testing, e.g., to see the raw output.
121 TEST_F(StackTraceTest, DebugOutputToStream) { 121 TEST_F(StackTraceTest, DebugOutputToStream) {
122 StackTrace trace; 122 StackTrace trace;
123 std::ostringstream os; 123 std::ostringstream os;
124 trace.OutputToStream(&os); 124 trace.OutputToStream(&os);
125 VLOG(1) << os.str(); 125 VLOG(1) << os.str();
126 } 126 }
127 127
128 // The test is used for manual testing, e.g., to see the raw output. 128 // The test is used for manual testing, e.g., to see the raw output.
129 TEST_F(StackTraceTest, DebugPrintBacktrace) { 129 // Android implementation crashes due to SIGSTKFLT http://crbug.com/248775
130 #if defined(OS_ANDROID)
131 #define MAYBE_DebugPrintBacktrace DISABLED_DebugPrintBacktrace
132 #else
133 #define MAYBE_DebugPrintBacktrace DebugPrintBacktrace
134 #endif
135 TEST_F(StackTraceTest, MAYBE_DebugPrintBacktrace) {
130 StackTrace().PrintBacktrace(); 136 StackTrace().PrintBacktrace();
131 } 137 }
132 138
133 #if defined(OS_POSIX) && !defined(OS_ANDROID) 139 #if defined(OS_POSIX) && !defined(OS_ANDROID)
134 #if !defined(OS_IOS) 140 #if !defined(OS_IOS)
135 MULTIPROCESS_TEST_MAIN(MismatchedMallocChildProcess) { 141 MULTIPROCESS_TEST_MAIN(MismatchedMallocChildProcess) {
136 char* pointer = new char[10]; 142 char* pointer = new char[10];
137 delete pointer; 143 delete pointer;
138 return 2; 144 return 2;
139 } 145 }
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 EXPECT_EQ("688", itoa_r_wrapper(0x688, 128, 16, 1)); 225 EXPECT_EQ("688", itoa_r_wrapper(0x688, 128, 16, 1));
220 EXPECT_EQ("688", itoa_r_wrapper(0x688, 128, 16, 2)); 226 EXPECT_EQ("688", itoa_r_wrapper(0x688, 128, 16, 2));
221 EXPECT_EQ("688", itoa_r_wrapper(0x688, 128, 16, 3)); 227 EXPECT_EQ("688", itoa_r_wrapper(0x688, 128, 16, 3));
222 EXPECT_EQ("0688", itoa_r_wrapper(0x688, 128, 16, 4)); 228 EXPECT_EQ("0688", itoa_r_wrapper(0x688, 128, 16, 4));
223 EXPECT_EQ("00688", itoa_r_wrapper(0x688, 128, 16, 5)); 229 EXPECT_EQ("00688", itoa_r_wrapper(0x688, 128, 16, 5));
224 } 230 }
225 #endif // defined(OS_POSIX) && !defined(OS_ANDROID) 231 #endif // defined(OS_POSIX) && !defined(OS_ANDROID)
226 232
227 } // namespace debug 233 } // namespace debug
228 } // namespace base 234 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698