Bug 718254: Get the IPDL unit test harness compiling again. r=bent

This commit is contained in:
Chris Jones 2012-02-02 00:33:06 -08:00
parent 9fbd4480c6
commit c4dc650eff
2 changed files with 16 additions and 17 deletions

View File

@ -2,11 +2,11 @@
// Autogenerated from Python template. Hands off.
//
#include "IPDLUnitTests.h"
#include <stdlib.h>
#include <string.h>
#include "IPDLUnitTests.h"
#include "base/command_line.h"
#include "base/string_util.h"
#include "base/thread.h"
@ -20,17 +20,20 @@
${INCLUDES}
//-----------------------------------------------------------------------------
using mozilla::_ipdltest::IPDLUnitTestSubprocess;
using namespace base;
using namespace std;
void* mozilla::_ipdltest::gParentActor;
IPDLUnitTestSubprocess* mozilla::_ipdltest::gSubprocess;
namespace mozilla {
namespace _ipdltest {
void* mozilla::_ipdltest::gChildActor;
void* gParentActor;
IPDLUnitTestSubprocess* gSubprocess;
void* gChildActor;
// Note: in threaded mode, this will be non-null (for both parent and
// child, since they share one set of globals).
Thread* mozilla::_ipdltest::gChildThread;
Thread* gChildThread;
MessageLoop *gParentMessageLoop;
bool gParentDone;
bool gChildDone;
@ -38,26 +41,19 @@ bool gChildDone;
//-----------------------------------------------------------------------------
// data/functions accessed by both parent and child processes
namespace {
char* gIPDLUnitTestName = NULL;
}
namespace mozilla {
namespace _ipdltest {
const char* const
IPDLUnitTestName()
{
if (!gIPDLUnitTestName) {
#if defined(OS_WIN)
std::vector<std::wstring> args =
vector<wstring> args =
CommandLine::ForCurrentProcess()->GetLooseValues();
gIPDLUnitTestName = strdup(WideToUTF8(args[0]).c_str());
#elif defined(OS_POSIX)
std::vector<std::string> argv =
CommandLine::ForCurrentProcess()->argv();
gIPDLUnitTestName = strdup(argv[1].c_str());
vector<string> argv = CommandLine::ForCurrentProcess()->argv();
gIPDLUnitTestName = ::moz_xstrdup(argv[1].c_str());
#else
# error Sorry
#endif

View File

@ -17,6 +17,9 @@ public:
TestSysVShmemParent() { }
virtual ~TestSysVShmemParent() { }
static bool RunTestInProcesses() { return true; }
static bool RunTestInThreads() { return true; }
void Main();
protected: