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

Unified Diff: base/threading/non_thread_safe_unittest.cc

Issue 2162053006: Move EXPECT_DCHECK_DEATH from base/task_scheduler and use it in relevant base/ tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge up to r408965 Created 4 years, 5 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 | « base/test/gtest_util.h ('k') | base/threading/thread_checker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/non_thread_safe_unittest.cc
diff --git a/base/threading/non_thread_safe_unittest.cc b/base/threading/non_thread_safe_unittest.cc
index d523fc55b101904f601adb63b4dc09f01c540972..c503c1893384ab8118ce435146d1ecc8075da0d2 100644
--- a/base/threading/non_thread_safe_unittest.cc
+++ b/base/threading/non_thread_safe_unittest.cc
@@ -8,6 +8,7 @@
#include "base/logging.h"
#include "base/macros.h"
+#include "base/test/gtest_util.h"
#include "base/threading/simple_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -106,8 +107,6 @@ TEST(NonThreadSafeTest, DetachThenDestructOnDifferentThread) {
delete_on_thread.Join();
}
-#if GTEST_HAS_DEATH_TEST || !ENABLE_NON_THREAD_SAFE
-
void NonThreadSafeClass::MethodOnDifferentThreadImpl() {
std::unique_ptr<NonThreadSafeClass> non_thread_safe_class(
new NonThreadSafeClass);
@@ -122,9 +121,8 @@ void NonThreadSafeClass::MethodOnDifferentThreadImpl() {
#if ENABLE_NON_THREAD_SAFE
TEST(NonThreadSafeDeathTest, MethodNotAllowedOnDifferentThreadInDebug) {
- ASSERT_DEATH({
- NonThreadSafeClass::MethodOnDifferentThreadImpl();
- }, "");
+ ASSERT_DCHECK_DEATH({ NonThreadSafeClass::MethodOnDifferentThreadImpl(); },
+ "");
}
#else
TEST(NonThreadSafeTest, MethodAllowedOnDifferentThreadInRelease) {
@@ -147,9 +145,8 @@ void NonThreadSafeClass::DestructorOnDifferentThreadImpl() {
#if ENABLE_NON_THREAD_SAFE
TEST(NonThreadSafeDeathTest, DestructorNotAllowedOnDifferentThreadInDebug) {
- ASSERT_DEATH({
- NonThreadSafeClass::DestructorOnDifferentThreadImpl();
- }, "");
+ ASSERT_DCHECK_DEATH(
+ { NonThreadSafeClass::DestructorOnDifferentThreadImpl(); }, "");
}
#else
TEST(NonThreadSafeTest, DestructorAllowedOnDifferentThreadInRelease) {
@@ -157,8 +154,6 @@ TEST(NonThreadSafeTest, DestructorAllowedOnDifferentThreadInRelease) {
}
#endif // ENABLE_NON_THREAD_SAFE
-#endif // GTEST_HAS_DEATH_TEST || !ENABLE_NON_THREAD_SAFE
-
// Just in case we ever get lumped together with other compilation units.
#undef ENABLE_NON_THREAD_SAFE
« no previous file with comments | « base/test/gtest_util.h ('k') | base/threading/thread_checker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698