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

Unified Diff: sandbox/linux/syscall_broker/broker_file_permission_unittest.cc

Issue 2709203002: sandbox tests: Adapt test expectations to new CHECK() behavior (Closed)
Patch Set: Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sandbox/linux/tests/unit_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/syscall_broker/broker_file_permission_unittest.cc
diff --git a/sandbox/linux/syscall_broker/broker_file_permission_unittest.cc b/sandbox/linux/syscall_broker/broker_file_permission_unittest.cc
index f79fa92ffe974dc75d86c52b609a0d5d96e046be..83840779f9641c9eb4af507b2e922c805e6dbf37 100644
--- a/sandbox/linux/syscall_broker/broker_file_permission_unittest.cc
+++ b/sandbox/linux/syscall_broker/broker_file_permission_unittest.cc
@@ -46,17 +46,19 @@ SANDBOX_TEST(BrokerFilePermission, CreateGoodRecursive) {
BrokerFilePermission perm = BrokerFilePermission::ReadOnlyRecursive(kPath);
}
-#if defined(OS_ANDROID) && defined(OFFICIAL_BUILD) && defined(NDEBUG)
-#define DEATH_BY_SIGILL(msg) DEATH_BY_SIGNAL(SIGILL)
+// In official builds, CHECK(x) causes a SIGTRAP on the architectures where the
+// sanbox is enabled (that are x86, x86_64, arm64 and 32-bit arm processes
+// running on a arm64 kernel).
+#if defined(OFFICIAL_BUILD)
+#define DEATH_BY_CHECK(msg) DEATH_BY_SIGNAL(SIGTRAP)
#else
-#define DEATH_BY_SIGILL(msg) DEATH_MESSAGE(msg)
+#define DEATH_BY_CHECK(msg) DEATH_MESSAGE(msg)
#endif
SANDBOX_DEATH_TEST(
BrokerFilePermission,
CreateBad,
- DEATH_BY_SIGILL(BrokerFilePermissionTester::GetErrorMessage())
-) {
+ DEATH_BY_CHECK(BrokerFilePermissionTester::GetErrorMessage())) {
const char kPath[] = "/tmp/bad/";
BrokerFilePermission perm = BrokerFilePermission::ReadOnly(kPath);
}
@@ -64,8 +66,7 @@ SANDBOX_DEATH_TEST(
SANDBOX_DEATH_TEST(
BrokerFilePermission,
CreateBadRecursive,
- DEATH_BY_SIGILL(BrokerFilePermissionTester::GetErrorMessage())
-) {
+ DEATH_BY_CHECK(BrokerFilePermissionTester::GetErrorMessage())) {
const char kPath[] = "/tmp/bad";
BrokerFilePermission perm = BrokerFilePermission::ReadOnlyRecursive(kPath);
}
@@ -73,8 +74,7 @@ SANDBOX_DEATH_TEST(
SANDBOX_DEATH_TEST(
BrokerFilePermission,
CreateBadNotAbs,
- DEATH_BY_SIGILL(BrokerFilePermissionTester::GetErrorMessage())
-) {
+ DEATH_BY_CHECK(BrokerFilePermissionTester::GetErrorMessage())) {
const char kPath[] = "tmp/bad";
BrokerFilePermission perm = BrokerFilePermission::ReadOnly(kPath);
}
@@ -82,8 +82,7 @@ SANDBOX_DEATH_TEST(
SANDBOX_DEATH_TEST(
BrokerFilePermission,
CreateBadEmpty,
- DEATH_BY_SIGILL(BrokerFilePermissionTester::GetErrorMessage())
-) {
+ DEATH_BY_CHECK(BrokerFilePermissionTester::GetErrorMessage())) {
const char kPath[] = "";
BrokerFilePermission perm = BrokerFilePermission::ReadOnly(kPath);
}
« no previous file with comments | « no previous file | sandbox/linux/tests/unit_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698