diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-17 19:40:11 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-17 19:40:11 +0000 |
commit | 20e14913cdb627bc6d6751dedc18fe23c3893671 (patch) | |
tree | 81654b4186f92345c8435bf10579aca31b14543a /base/process_util_unittest.cc | |
parent | 2045b41427fd10137d9c97dbc3d2ab536fd45480 (diff) | |
download | chromium_src-20e14913cdb627bc6d6751dedc18fe23c3893671.zip chromium_src-20e14913cdb627bc6d6751dedc18fe23c3893671.tar.gz chromium_src-20e14913cdb627bc6d6751dedc18fe23c3893671.tar.bz2 |
Re-land part of r55416, minus actually moving the test_suite.h contents to a .cc file.
Cleanup in base. This moves the implementation (and a bunch of header file
dependencies) from the multiprocess test and the test_suite headers to .cc
files. Moves multiprocess_test to the test directory, and all of this stuff to
the existing base_test_support project. I also used the base namespace.
Previously other projects included this functionality just by #include because
it was all inline, so I had to add dependencies on base_test_support in a few
places.
Moves and renames the command line switch this was using to base_switches. Move
the base switch for process type to chrome switches.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/3026055
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56399 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util_unittest.cc')
-rw-r--r-- | base/process_util_unittest.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/base/process_util_unittest.cc b/base/process_util_unittest.cc index 6f4ed39..645ef77 100644 --- a/base/process_util_unittest.cc +++ b/base/process_util_unittest.cc @@ -9,13 +9,14 @@ #include "base/command_line.h" #include "base/eintr_wrapper.h" #include "base/file_path.h" -#include "base/multiprocess_test.h" #include "base/path_service.h" #include "base/platform_thread.h" #include "base/process_util.h" #include "base/scoped_ptr.h" +#include "base/test/multiprocess_test.h" #include "base/utf_string_conversions.h" #include "testing/gtest/include/gtest/gtest.h" +#include "testing/multiprocess_func_list.h" #if defined(OS_LINUX) #include <errno.h> @@ -62,7 +63,7 @@ void SignalChildren(const char* filename) { } // namespace -class ProcessUtilTest : public MultiProcessTest { +class ProcessUtilTest : public base::MultiProcessTest { #if defined(OS_POSIX) public: // Spawn a child process that counts how many file descriptors are open. @@ -75,7 +76,7 @@ MULTIPROCESS_TEST_MAIN(SimpleChildProcess) { } TEST_F(ProcessUtilTest, SpawnChild) { - base::ProcessHandle handle = this->SpawnChild("SimpleChildProcess"); + base::ProcessHandle handle = this->SpawnChild("SimpleChildProcess", false); ASSERT_NE(base::kNullProcessHandle, handle); EXPECT_TRUE(base::WaitForSingleProcess(handle, 5000)); base::CloseProcessHandle(handle); @@ -88,7 +89,7 @@ MULTIPROCESS_TEST_MAIN(SlowChildProcess) { TEST_F(ProcessUtilTest, KillSlowChild) { remove("SlowChildProcess.die"); - base::ProcessHandle handle = this->SpawnChild("SlowChildProcess"); + base::ProcessHandle handle = this->SpawnChild("SlowChildProcess", false); ASSERT_NE(base::kNullProcessHandle, handle); SignalChildren("SlowChildProcess.die"); EXPECT_TRUE(base::WaitForSingleProcess(handle, 5000)); @@ -98,7 +99,7 @@ TEST_F(ProcessUtilTest, KillSlowChild) { TEST_F(ProcessUtilTest, DidProcessCrash) { remove("SlowChildProcess.die"); - base::ProcessHandle handle = this->SpawnChild("SlowChildProcess"); + base::ProcessHandle handle = this->SpawnChild("SlowChildProcess", false); ASSERT_NE(base::kNullProcessHandle, handle); bool child_exited = true; @@ -118,7 +119,7 @@ TEST_F(ProcessUtilTest, DidProcessCrash) { // Note: a platform may not be willing or able to lower the priority of // a process. The calls to SetProcessBackground should be noops then. TEST_F(ProcessUtilTest, SetProcessBackgrounded) { - base::ProcessHandle handle = this->SpawnChild("SimpleChildProcess"); + base::ProcessHandle handle = this->SpawnChild("SimpleChildProcess", false); base::Process process(handle); int old_priority = process.GetPriority(); process.SetProcessBackgrounded(true); |