summaryrefslogtreecommitdiffstats
path: root/sandbox
diff options
context:
space:
mode:
authorleecam <leecam@chromium.org>2014-12-01 17:21:35 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-02 01:22:54 +0000
commit6a8e53b5431b5b00cc0f5a88b7df69cf0c7fafa3 (patch)
tree22597812ecab234dc38e378f063d0f62459d103b /sandbox
parenta64e652d907af00305a8d13000b63526b57f7bfd (diff)
downloadchromium_src-6a8e53b5431b5b00cc0f5a88b7df69cf0c7fafa3.zip
chromium_src-6a8e53b5431b5b00cc0f5a88b7df69cf0c7fafa3.tar.gz
chromium_src-6a8e53b5431b5b00cc0f5a88b7df69cf0c7fafa3.tar.bz2
sandbox: Fix DeathMessage so CHECK messages are caught in all builds
The log messages for CHECK(...) are dropped for official builds, this CL fixes up DeathMessage to look for SIGABRTs in that case. BUG=437312 TEST=sandbox_linux_unitests official and non-official in R and D Review URL: https://codereview.chromium.org/766343003 Cr-Commit-Position: refs/heads/master@{#306313}
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/linux/tests/unit_tests.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/sandbox/linux/tests/unit_tests.cc b/sandbox/linux/tests/unit_tests.cc
index b7c3af6..5872e94 100644
--- a/sandbox/linux/tests/unit_tests.cc
+++ b/sandbox/linux/tests/unit_tests.cc
@@ -263,6 +263,16 @@ void UnitTests::DeathMessage(int status,
bool subprocess_exited_without_matching_message =
msg.find(expected_msg) == std::string::npos;
+
+// In official builds CHECK messages are dropped, so look for SIGABRT.
+// See https://code.google.com/p/chromium/issues/detail?id=437312
+#if defined(OFFICIAL_BUILD) && defined(NDEBUG) && !defined(OS_ANDROID)
+ if (subprocess_exited_without_matching_message) {
+ static const char kSigAbortMessage[] = "Received signal 6";
+ subprocess_exited_without_matching_message =
+ msg.find(kSigAbortMessage) == std::string::npos;
+ }
+#endif
EXPECT_FALSE(subprocess_exited_without_matching_message) << details;
}