gecko-dev/ipc/ipdl/test/cxx/TestManyChildAllocs.h

100 строки
2.2 KiB
C
Исходник Обычный вид История

2009-10-06 22:05:47 +04:00
#ifndef mozilla__ipdltest_TestManyChildAllocs_h
#define mozilla__ipdltest_TestManyChildAllocs_h 1
#include "mozilla/_ipdltest/IPDLUnitTests.h"
2009-10-06 22:05:47 +04:00
#include "mozilla/_ipdltest/PTestManyChildAllocsParent.h"
#include "mozilla/_ipdltest/PTestManyChildAllocsChild.h"
#include "mozilla/_ipdltest/PTestManyChildAllocsSubParent.h"
#include "mozilla/_ipdltest/PTestManyChildAllocsSubChild.h"
namespace mozilla {
namespace _ipdltest {
// top-level protocol
class TestManyChildAllocsParent :
public PTestManyChildAllocsParent
{
public:
TestManyChildAllocsParent();
virtual ~TestManyChildAllocsParent();
void Main();
protected:
NS_OVERRIDE
2009-10-06 22:05:47 +04:00
virtual bool RecvDone();
NS_OVERRIDE
2009-10-06 22:05:47 +04:00
virtual bool DeallocPTestManyChildAllocsSub(PTestManyChildAllocsSubParent* __a);
NS_OVERRIDE
2009-10-06 22:05:47 +04:00
virtual PTestManyChildAllocsSubParent* AllocPTestManyChildAllocsSub();
NS_OVERRIDE
virtual void ActorDestroy(ActorDestroyReason why)
{
if (NormalShutdown != why)
fail("unexpected destruction!");
passed("ok");
QuitParent();
}
2009-10-06 22:05:47 +04:00
};
class TestManyChildAllocsChild :
public PTestManyChildAllocsChild
{
public:
TestManyChildAllocsChild();
virtual ~TestManyChildAllocsChild();
protected:
NS_OVERRIDE
2009-10-06 22:05:47 +04:00
virtual bool RecvGo();
NS_OVERRIDE
2009-10-06 22:05:47 +04:00
virtual bool DeallocPTestManyChildAllocsSub(PTestManyChildAllocsSubChild* __a);
NS_OVERRIDE
2009-10-06 22:05:47 +04:00
virtual PTestManyChildAllocsSubChild* AllocPTestManyChildAllocsSub();
NS_OVERRIDE
virtual void ActorDestroy(ActorDestroyReason why)
{
if (NormalShutdown != why)
fail("unexpected destruction!");
QuitChild();
}
2009-10-06 22:05:47 +04:00
};
// do-nothing sub-protocol actors
class TestManyChildAllocsSubParent :
public PTestManyChildAllocsSubParent
{
public:
TestManyChildAllocsSubParent() { }
virtual ~TestManyChildAllocsSubParent() { }
protected:
NS_OVERRIDE
2009-10-06 22:05:47 +04:00
virtual bool RecvHello() { return true; }
};
class TestManyChildAllocsSubChild :
public PTestManyChildAllocsSubChild
{
public:
TestManyChildAllocsSubChild() { }
virtual ~TestManyChildAllocsSubChild() { }
};
} // namepsace _ipdltest
} // namespace mozilla
#endif // ifndef mozilla__ipdltest_TestManyChildAllocs_h