Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(669)

Unified Diff: base/test_suite.h

Issue 8864: 1) Add a new MULTIPROCESS_TEST_MAIN macro to store child process names... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/stats_table_unittest.cc ('k') | testing/SConscript.gtest » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test_suite.h
===================================================================
--- base/test_suite.h (revision 4068)
+++ base/test_suite.h (working copy)
@@ -16,15 +16,12 @@
#include "base/logging.h"
#include "base/multiprocess_test.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "testing/multiprocess_func_list.h"
#if defined(OS_WIN)
#include <windows.h>
-#include "base/multiprocess_test.h"
#elif defined(OS_LINUX)
-#include <dlfcn.h>
#include <gtk/gtk.h>
-#elif defined(OS_MACOSX)
-#include <dlfcn.h>
#endif
class TestSuite {
@@ -47,26 +44,7 @@
// Convert our function name to a usable string for GetProcAddress.
std::string func_name(client_func.begin(), client_func.end());
-#if defined(OS_WIN)
- // Get our module handle and search for an exported function
- // which we can use as our client main.
- MultiProcessTest::ChildFunctionPtr func =
- reinterpret_cast<MultiProcessTest::ChildFunctionPtr>(
- GetProcAddress(GetModuleHandle(NULL), func_name.c_str()));
-#elif defined(OS_LINUX)
- void* exobj = dlopen(0, RTLD_LAZY);
- MultiProcessTest::ChildFunctionPtr func =
- reinterpret_cast<MultiProcessTest::ChildFunctionPtr>(
- dlsym(exobj, func_name.c_str()));
-#elif defined(OS_MACOSX)
- MultiProcessTest::ChildFunctionPtr func =
- reinterpret_cast<MultiProcessTest::ChildFunctionPtr>(
- dlsym(RTLD_SELF, func_name.c_str()));
-#endif // defined(OS_MACOSX)
-
- if (func)
- return (*func)();
- return -1;
+ return multi_process_function_list::InvokeChildProcessTest(func_name);
}
int result = RUN_ALL_TESTS();
« no previous file with comments | « base/stats_table_unittest.cc ('k') | testing/SConscript.gtest » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698