2009-10-19 19:12:25 -07:00
|
|
|
#ifndef mozilla_ipdltest_TestDesc_h
|
|
|
|
#define mozilla_ipdltest_TestDesc_h
|
|
|
|
|
2009-12-03 00:16:28 -08:00
|
|
|
#include "mozilla/_ipdltest/IPDLUnitTests.h"
|
|
|
|
|
2009-10-19 19:12:25 -07:00
|
|
|
#include "mozilla/_ipdltest/PTestDescParent.h"
|
|
|
|
#include "mozilla/_ipdltest/PTestDescChild.h"
|
|
|
|
|
|
|
|
#include "mozilla/_ipdltest/PTestDescSubParent.h"
|
|
|
|
#include "mozilla/_ipdltest/PTestDescSubChild.h"
|
|
|
|
|
|
|
|
#include "mozilla/_ipdltest/PTestDescSubsubParent.h"
|
|
|
|
#include "mozilla/_ipdltest/PTestDescSubsubChild.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace _ipdltest {
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Top-level
|
|
|
|
//
|
|
|
|
class TestDescParent :
|
|
|
|
public PTestDescParent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TestDescParent() { }
|
|
|
|
virtual ~TestDescParent() { }
|
|
|
|
|
|
|
|
void Main();
|
|
|
|
|
2009-12-03 00:16:28 -08:00
|
|
|
NS_OVERRIDE
|
2009-10-19 19:12:25 -07:00
|
|
|
virtual bool RecvOk(PTestDescSubsubParent* a);
|
|
|
|
|
|
|
|
protected:
|
2009-12-03 00:16:28 -08:00
|
|
|
NS_OVERRIDE
|
2010-05-22 12:35:34 -07:00
|
|
|
virtual PTestDescSubParent* AllocPTestDescSub(PTestDescSubsubParent*);
|
2009-12-03 00:16:28 -08:00
|
|
|
NS_OVERRIDE
|
2009-10-19 19:12:25 -07:00
|
|
|
virtual bool DeallocPTestDescSub(PTestDescSubParent* actor);
|
2009-12-03 00:16:28 -08:00
|
|
|
|
|
|
|
NS_OVERRIDE
|
|
|
|
virtual void ActorDestroy(ActorDestroyReason why)
|
|
|
|
{
|
|
|
|
if (NormalShutdown != why)
|
|
|
|
fail("unexpected destruction!");
|
|
|
|
passed("ok");
|
|
|
|
QuitParent();
|
|
|
|
}
|
2009-10-19 19:12:25 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class TestDescChild :
|
|
|
|
public PTestDescChild
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TestDescChild() { }
|
|
|
|
virtual ~TestDescChild() { }
|
|
|
|
|
|
|
|
protected:
|
2009-12-03 00:16:28 -08:00
|
|
|
NS_OVERRIDE
|
2010-05-22 12:35:34 -07:00
|
|
|
virtual PTestDescSubChild* AllocPTestDescSub(PTestDescSubsubChild*);
|
2009-12-03 00:16:28 -08:00
|
|
|
|
|
|
|
NS_OVERRIDE
|
2009-10-19 19:12:25 -07:00
|
|
|
virtual bool DeallocPTestDescSub(PTestDescSubChild* actor);
|
2009-12-03 00:16:28 -08:00
|
|
|
|
|
|
|
NS_OVERRIDE
|
2009-10-19 19:12:25 -07:00
|
|
|
virtual bool RecvTest(PTestDescSubsubChild* a);
|
2009-12-03 00:16:28 -08:00
|
|
|
|
|
|
|
NS_OVERRIDE
|
|
|
|
virtual void ActorDestroy(ActorDestroyReason why)
|
|
|
|
{
|
|
|
|
if (NormalShutdown != why)
|
|
|
|
fail("unexpected destruction!");
|
|
|
|
QuitChild();
|
|
|
|
}
|
2009-10-19 19:12:25 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// First descendent
|
|
|
|
//
|
|
|
|
class TestDescSubParent :
|
|
|
|
public PTestDescSubParent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TestDescSubParent() { }
|
|
|
|
virtual ~TestDescSubParent() { }
|
|
|
|
|
|
|
|
protected:
|
2009-12-03 00:16:28 -08:00
|
|
|
NS_OVERRIDE
|
2009-10-19 19:12:25 -07:00
|
|
|
virtual PTestDescSubsubParent* AllocPTestDescSubsub();
|
2009-12-03 00:16:28 -08:00
|
|
|
|
|
|
|
NS_OVERRIDE
|
2009-10-19 19:12:25 -07:00
|
|
|
virtual bool DeallocPTestDescSubsub(PTestDescSubsubParent* actor);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class TestDescSubChild :
|
|
|
|
public PTestDescSubChild
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TestDescSubChild() { }
|
|
|
|
virtual ~TestDescSubChild() { }
|
|
|
|
|
|
|
|
protected:
|
2009-12-03 00:16:28 -08:00
|
|
|
NS_OVERRIDE
|
2009-10-19 19:12:25 -07:00
|
|
|
virtual PTestDescSubsubChild* AllocPTestDescSubsub();
|
2009-12-03 00:16:28 -08:00
|
|
|
NS_OVERRIDE
|
2009-10-19 19:12:25 -07:00
|
|
|
virtual bool DeallocPTestDescSubsub(PTestDescSubsubChild* actor);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Grand-descendent
|
|
|
|
//
|
|
|
|
class TestDescSubsubParent :
|
|
|
|
public PTestDescSubsubParent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TestDescSubsubParent() { }
|
|
|
|
virtual ~TestDescSubsubParent() { }
|
|
|
|
};
|
|
|
|
|
|
|
|
class TestDescSubsubChild :
|
|
|
|
public PTestDescSubsubChild
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TestDescSubsubChild() { }
|
|
|
|
virtual ~TestDescSubsubChild() { }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // ifndef mozilla_ipdltest_TestDesc_h
|