summaryrefslogtreecommitdiffstats
path: root/base/multiprocess_test.h
diff options
context:
space:
mode:
authorjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-29 20:46:04 +0000
committerjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-29 20:46:04 +0000
commit307f536386aad3abf7c0978b892ffac059eb0be5 (patch)
tree9e59dd49ecdd90a63e007c37bdd27cc045549138 /base/multiprocess_test.h
parentfcbaeacfce08303236709e2603e64fc40bdba435 (diff)
downloadchromium_src-307f536386aad3abf7c0978b892ffac059eb0be5.zip
chromium_src-307f536386aad3abf7c0978b892ffac059eb0be5.tar.gz
chromium_src-307f536386aad3abf7c0978b892ffac059eb0be5.tar.bz2
1) Add a new MULTIPROCESS_TEST_MAIN macro to store child process names
in a lookup table. Previously we were using different mechanisms on each platform to look up child process names at runtime. This broke on OS X where we strip the symbol table on release executables. 2) Enable process_util_unittest on OS X. Review URL: http://codereview.chromium.org/8864 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4165 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/multiprocess_test.h')
-rw-r--r--base/multiprocess_test.h18
1 files changed, 6 insertions, 12 deletions
diff --git a/base/multiprocess_test.h b/base/multiprocess_test.h
index fb02107..69aa50b 100644
--- a/base/multiprocess_test.h
+++ b/base/multiprocess_test.h
@@ -10,6 +10,7 @@
#include "base/process_util.h"
#include "base/string_util.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "testing/multiprocess_func_list.h"
#if defined(OS_POSIX)
#include <sys/types.h>
@@ -26,21 +27,15 @@ static const wchar_t kRunClientProcess[] = L"client";
// To create a multiprocess test simply follow these steps:
//
// 1) Derive your test from MultiProcessTest.
-// 2) Modify your mainline so that if it sees the
-// kRunClientProcess switch, it will deal with it.
-// 3) Create a mainline function for the child processes
-// 4) Call SpawnChild("foo"), where "foo" is the name of
+// 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.
-// 5) On Linux, add the function's name to the list in the file
-// base_unittests_exported_symbols.version
// That's it!
//
class MultiProcessTest : public PlatformTest {
- public:
- // Prototype function for a client function. Multi-process
- // clients must provide a callback with this signature to run.
- typedef int (*ChildFunctionPtr)();
-
protected:
// Run a child process.
// 'procname' is the name of a function which the child will
@@ -79,4 +74,3 @@ class MultiProcessTest : public PlatformTest {
};
#endif // BASE_MULTIPROCESS_TEST_H__
-