Index: sandbox/linux/tests/unit_tests.cc |
diff --git a/sandbox/linux/tests/unit_tests.cc b/sandbox/linux/tests/unit_tests.cc |
index 282c718d260abe1dfbe04abd302cae6383b3d266..16193262fde435399e3d42638ca5605530c88d77 100644 |
--- a/sandbox/linux/tests/unit_tests.cc |
+++ b/sandbox/linux/tests/unit_tests.cc |
@@ -42,8 +42,6 @@ int CountThreads() { |
namespace sandbox { |
-extern bool kAllowForkWithThreads; |
- |
bool IsAndroid() { |
#if defined(OS_ANDROID) |
return true; |
@@ -128,26 +126,18 @@ void UnitTests::RunTestInProcess(SandboxTestRunner* test_runner, |
// appear as still running in /proc. |
// We poll /proc, with an exponential back-off. At most, we'll sleep around |
// 2^iterations nanoseconds in nanosleep(). |
- if (!kAllowForkWithThreads) { |
- for (unsigned int iteration = 0; iteration < 30; iteration++) { |
- struct timespec ts = {0, 1L << iteration /* nanoseconds */}; |
- PCHECK(0 == HANDLE_EINTR(nanosleep(&ts, &ts))); |
- num_threads = CountThreads(); |
- if (kNumExpectedThreads == num_threads) |
- break; |
- } |
- } |
- |
- const std::string multiple_threads_error = |
- "Running sandbox tests with multiple threads " |
- "is not supported and will make the tests flaky."; |
- if (!kAllowForkWithThreads) { |
- ASSERT_EQ(kNumExpectedThreads, num_threads) << multiple_threads_error; |
- } else { |
- if (kNumExpectedThreads != num_threads) |
- LOG(ERROR) << multiple_threads_error; |
+ for (unsigned int iteration = 0; iteration < 30; iteration++) { |
+ struct timespec ts = {0, 1L << iteration /* nanoseconds */}; |
+ PCHECK(0 == HANDLE_EINTR(nanosleep(&ts, &ts))); |
+ num_threads = CountThreads(); |
+ if (kNumExpectedThreads == num_threads) |
+ break; |
} |
+ ASSERT_EQ(kNumExpectedThreads, num_threads) |
+ << "Running sandbox tests with multiple threads " |
+ << "is not supported and will make the tests " |
+ << "flaky.\n"; |
Mark Seaborn
2014/05/08 15:29:39
Nit: Isn't '\n' unnecessary for ASSERT_EQ? Also f
jln (DO NOT USE THIS)
2014/05/08 16:30:02
Ohh good catch!
hamaji
2014/05/10 08:06:24
Done. After I reverted https://codereview.chromium
|
int fds[2]; |
ASSERT_EQ(0, pipe(fds)); |
// Check that our pipe is not on one of the standard file descriptor. |