diff options
author | hamaji@chromium.org <hamaji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-10 11:38:57 +0000 |
---|---|---|
committer | hamaji@chromium.org <hamaji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-10 11:38:57 +0000 |
commit | 95bc10a47274fa19d9de8bcaafdcc74e9bc4cb54 (patch) | |
tree | 40d990d821482d9437519e8707c8e8e3a12a6d64 /sandbox/linux | |
parent | 5cd96dd80d40a56f8994a9b0daa483dc20f0b66f (diff) | |
download | chromium_src-95bc10a47274fa19d9de8bcaafdcc74e9bc4cb54.zip chromium_src-95bc10a47274fa19d9de8bcaafdcc74e9bc4cb54.tar.gz chromium_src-95bc10a47274fa19d9de8bcaafdcc74e9bc4cb54.tar.bz2 |
Non-SFI NaCl: Stop running sandbox tests in components_unittests
Also revert the temporary change for the sandbox test framework,
which allows fork() with threads.
https://codereview.chromium.org/242383003
TEST=nacl_loader_unittests, components_unittests, and trybots
BUG=364751
Review URL: https://codereview.chromium.org/273623002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269558 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox/linux')
-rw-r--r-- | sandbox/linux/tests/main.cc | 3 | ||||
-rw-r--r-- | sandbox/linux/tests/unit_tests.cc | 29 |
2 files changed, 9 insertions, 23 deletions
diff --git a/sandbox/linux/tests/main.cc b/sandbox/linux/tests/main.cc index a736ea2..9ee384d 100644 --- a/sandbox/linux/tests/main.cc +++ b/sandbox/linux/tests/main.cc @@ -10,9 +10,6 @@ #include "testing/gtest/include/gtest/gtest.h" namespace sandbox { - -extern const bool kAllowForkWithThreads = false; - namespace { // Check for leaks in our tests. diff --git a/sandbox/linux/tests/unit_tests.cc b/sandbox/linux/tests/unit_tests.cc index d3ee81b..a57cf1a 100644 --- a/sandbox/linux/tests/unit_tests.cc +++ b/sandbox/linux/tests/unit_tests.cc @@ -43,8 +43,6 @@ int CountThreads() { namespace sandbox { -extern bool kAllowForkWithThreads; - bool IsAndroid() { #if defined(OS_ANDROID) return true; @@ -129,26 +127,17 @@ 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."; int fds[2]; ASSERT_EQ(0, pipe(fds)); // Check that our pipe is not on one of the standard file descriptor. |