summaryrefslogtreecommitdiffstats
path: root/base/test/multiprocess_test.h
diff options
context:
space:
mode:
authornsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-09 17:32:32 +0000
committernsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-09 17:32:32 +0000
commit85f633544904e9a2e1b47ad3a713ad764c81eaf2 (patch)
tree78ad55aeacd41a6ad480a9f3a6af28040feace19 /base/test/multiprocess_test.h
parent53bb5675486a7a3ddb0f29482fc0217f7452f833 (diff)
downloadchromium_src-85f633544904e9a2e1b47ad3a713ad764c81eaf2.zip
chromium_src-85f633544904e9a2e1b47ad3a713ad764c81eaf2.tar.gz
chromium_src-85f633544904e9a2e1b47ad3a713ad764c81eaf2.tar.bz2
Revert 55400 - 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 TBR=brettw@chromium.org Review URL: http://codereview.chromium.org/3035062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55416 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/test/multiprocess_test.h')
-rw-r--r--base/test/multiprocess_test.h86
1 files changed, 0 insertions, 86 deletions
diff --git a/base/test/multiprocess_test.h b/base/test/multiprocess_test.h
deleted file mode 100644
index 5126abe..0000000
--- a/base/test/multiprocess_test.h
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef BASE_TEST_MULTIPROCESS_TEST_H_
-#define BASE_TEST_MULTIPROCESS_TEST_H_
-#pragma once
-
-#include <string>
-
-#include "base/basictypes.h"
-#include "base/process.h"
-#include "base/process_util.h"
-#include "build/build_config.h"
-#include "testing/platform_test.h"
-
-class CommandLine;
-
-namespace base {
-
-// A MultiProcessTest is a test class which makes it easier to
-// write a test which requires code running out of process.
-//
-// To create a multiprocess test simply follow these steps:
-//
-// 1) Derive your test from MultiProcessTest. Example:
-//
-// class MyTest : public MultiProcessTest {
-// };
-//
-// TEST_F(MyTest, TestCaseName) {
-// ...
-// }
-//
-// 2) Create a mainline function for the child processes and include
-// testing/multiprocess_func_list.h.
-// See the declaration of the MULTIPROCESS_TEST_MAIN macro
-// in that file for an example.
-// 3) Call SpawnChild("foo"), where "foo" is the name of
-// the function you wish to run in the child processes.
-// That's it!
-class MultiProcessTest : public PlatformTest {
- public:
- MultiProcessTest();
-
- protected:
- // Run a child process.
- // 'procname' is the name of a function which the child will
- // execute. It must be exported from this library in order to
- // run.
- //
- // Example signature:
- // extern "C" int __declspec(dllexport) FooBar() {
- // // do client work here
- // }
- //
- // Returns the handle to the child, or NULL on failure
- ProcessHandle SpawnChild(const std::string& procname, bool debug_on_start);
-
-#if defined(OS_POSIX)
- ProcessHandle SpawnChild(const std::string& procname,
- const file_handle_mapping_vector& fds_to_map,
- bool debug_on_start);
-#endif
-
- CommandLine MakeCmdLine(const std::string& procname, bool debug_on_start);
-
- private:
-#if defined(OS_WIN)
- ProcessHandle SpawnChildImpl(const std::string& procname,
- bool debug_on_start);
-
-#elif defined(OS_POSIX)
- // TODO(port): with the CommandLine refactoring, this code is very similar
- // to the Windows code. Investigate whether this can be made shorter.
- ProcessHandle SpawnChildImpl(const std::string& procname,
- const file_handle_mapping_vector& fds_to_map,
- bool debug_on_start);
-#endif
-
- DISALLOW_COPY_AND_ASSIGN(MultiProcessTest);
-};
-
-} // namespace base
-
-#endif // BASE_TEST_MULTIPROCESS_TEST_H_