summaryrefslogtreecommitdiffstats
path: root/base/cancellation_flag_unittest.cc
diff options
context:
space:
mode:
authortimurrrr@chromium.org <timurrrr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-10 20:33:02 +0000
committertimurrrr@chromium.org <timurrrr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-10 20:33:02 +0000
commit31a80f2ad70f9c29ca604bbda2a934b3fe6fc7f4 (patch)
treef0903b0947fc84421556ebec81fdc7de78087db5 /base/cancellation_flag_unittest.cc
parentb2ba996f96dfd3bde403fce818258d97e3ca8002 (diff)
downloadchromium_src-31a80f2ad70f9c29ca604bbda2a934b3fe6fc7f4.zip
chromium_src-31a80f2ad70f9c29ca604bbda2a934b3fe6fc7f4.tar.gz
chromium_src-31a80f2ad70f9c29ca604bbda2a934b3fe6fc7f4.tar.bz2
Force failing CHECK/DCHECKs to end the process on Windows.
The current implementation of Windows-only hook simply calls FAIL. According to http://code.google.com/p/googletest/issues/list?cursor=234 it is a misuse of FAIL macros (it may not shut down the process). As a result, it was impossible to write death tests on windows. BUG=24885 Review URL: http://codereview.chromium.org/482001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34273 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/cancellation_flag_unittest.cc')
-rw-r--r--base/cancellation_flag_unittest.cc14
1 files changed, 3 insertions, 11 deletions
diff --git a/base/cancellation_flag_unittest.cc b/base/cancellation_flag_unittest.cc
index ffc8cf0..52f6b1e 100644
--- a/base/cancellation_flag_unittest.cc
+++ b/base/cancellation_flag_unittest.cc
@@ -49,18 +49,10 @@ TEST(CancellationFlagTest, DoubleSetTest) {
ASSERT_TRUE(flag.IsSet());
}
-#if defined(OS_WIN)
-#define DISABLED_ON_WIN(x) DISABLED_##x
-#else
-#define DISABLED_ON_WIN(x) x
-#endif
-
-// CancellationFlag should die on a DCHECK if Set() is called from
-// other thread.
-// This test isn't Windows-friendly yet since ASSERT_DEATH doesn't catch tests
-// failed on DCHECK. See http://crbug.com/24885 for the details.
-TEST(CancellationFlagTest, DISABLED_ON_WIN(SetOnDifferentThreadDeathTest)) {
+TEST(CancellationFlagTest, SetOnDifferentThreadDeathTest) {
// Checks that Set() can't be called from any other thread.
+ // CancellationFlag should die on a DCHECK if Set() is called from
+ // other thread.
::testing::FLAGS_gtest_death_test_style = "threadsafe";
Thread t("CancellationFlagTest.SetOnDifferentThreadDeathTest");
ASSERT_TRUE(t.Start());