summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-18 04:30:14 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-18 04:30:14 +0000
commit54823b0f1ec8d65bf64423a64f727bbc8eb023a1 (patch)
treed8cabd5ef2f1413201b930520b923985db5caf25 /chrome/test
parent538ddce9c0e36665f2d34b6f7a731407afbcb554 (diff)
downloadchromium_src-54823b0f1ec8d65bf64423a64f727bbc8eb023a1.zip
chromium_src-54823b0f1ec8d65bf64423a64f727bbc8eb023a1.tar.gz
chromium_src-54823b0f1ec8d65bf64423a64f727bbc8eb023a1.tar.bz2
In release mode, trigger a SIGABRT rather than a SIGTRAP for fatal log errors, i.e. CHECK(false). Also enable tests to make sure we assert/crash as expected.
BUG=none TEST=Chrome in release mode generates crash dumps when CHECK() fails. See UI tests: AssertionTest.*:CheckFalseTest.*:RendererCrashTest.* Review URL: http://codereview.chromium.org/830003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41912 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/ui/ui_test.cc18
1 files changed, 11 insertions, 7 deletions
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index 48a2059..6e753b5 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -144,7 +144,6 @@ UITestBase::UITestBase(MessageLoop::Type msg_loop_type)
terminate_timeout_ms_(kWaitForTerminateMsec) {
PathService::Get(chrome::DIR_APP, &browser_directory_);
PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory_);
-
}
UITestBase::~UITestBase() {
@@ -182,9 +181,14 @@ void UITestBase::TearDown() {
// Check for crashes during the test
FilePath crash_dump_path;
PathService::Get(chrome::DIR_CRASH_DUMPS, &crash_dump_path);
- // Each crash creates two dump files, so we divide by two here.
int actual_crashes =
- file_util::CountFilesCreatedAfter(crash_dump_path, test_start_time_) / 2;
+ file_util::CountFilesCreatedAfter(crash_dump_path, test_start_time_);
+
+#if defined(OS_WIN)
+ // Each crash creates two dump files, so we divide by two here.
+ actual_crashes /= 2;
+#endif
+
std::wstring error_msg =
L"Encountered an unexpected crash in the program during this test.";
if (expected_crashes_ > 0 && actual_crashes == 0) {
@@ -1259,8 +1263,8 @@ void UITestBase::PrintIOPerfInfo(const char* test_name) {
}
// TODO(sgk): if/when base::ProcessMetrics returns real stats on mac:
- //scoped_ptr<base::ProcessMetrics> process_metrics(
- // base::ProcessMetrics::CreateProcessMetrics(process_handle));
+ // scoped_ptr<base::ProcessMetrics> process_metrics(
+ // base::ProcessMetrics::CreateProcessMetrics(process_handle));
scoped_ptr<ChromeTestProcessMetrics> process_metrics(
ChromeTestProcessMetrics::CreateProcessMetrics(process_handle));
IoCounters io_counters;
@@ -1362,8 +1366,8 @@ void UITestBase::PrintMemoryUsageInfo(const char* test_name) {
}
// TODO(sgk): if/when base::ProcessMetrics returns real stats on mac:
- //scoped_ptr<base::ProcessMetrics> process_metrics(
- // base::ProcessMetrics::CreateProcessMetrics(process_handle));
+ // scoped_ptr<base::ProcessMetrics> process_metrics(
+ // base::ProcessMetrics::CreateProcessMetrics(process_handle));
scoped_ptr<ChromeTestProcessMetrics> process_metrics(
ChromeTestProcessMetrics::CreateProcessMetrics(process_handle));