michael@0: #ifndef mozilla__ipdltest_TestManyChildAllocs_h michael@0: #define mozilla__ipdltest_TestManyChildAllocs_h 1 michael@0: michael@0: #include "mozilla/_ipdltest/IPDLUnitTests.h" michael@0: michael@0: #include "mozilla/_ipdltest/PTestManyChildAllocsParent.h" michael@0: #include "mozilla/_ipdltest/PTestManyChildAllocsChild.h" michael@0: michael@0: #include "mozilla/_ipdltest/PTestManyChildAllocsSubParent.h" michael@0: #include "mozilla/_ipdltest/PTestManyChildAllocsSubChild.h" michael@0: michael@0: namespace mozilla { michael@0: namespace _ipdltest { michael@0: michael@0: // top-level protocol michael@0: michael@0: class TestManyChildAllocsParent : michael@0: public PTestManyChildAllocsParent michael@0: { michael@0: public: michael@0: TestManyChildAllocsParent(); michael@0: virtual ~TestManyChildAllocsParent(); michael@0: michael@0: static bool RunTestInProcesses() { return true; } michael@0: static bool RunTestInThreads() { return true; } michael@0: michael@0: void Main(); michael@0: michael@0: protected: michael@0: virtual bool RecvDone() MOZ_OVERRIDE; michael@0: virtual bool DeallocPTestManyChildAllocsSubParent(PTestManyChildAllocsSubParent* __a) MOZ_OVERRIDE; michael@0: virtual PTestManyChildAllocsSubParent* AllocPTestManyChildAllocsSubParent() MOZ_OVERRIDE; michael@0: michael@0: virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE michael@0: { michael@0: if (NormalShutdown != why) michael@0: fail("unexpected destruction!"); michael@0: passed("ok"); michael@0: QuitParent(); michael@0: } michael@0: }; michael@0: michael@0: michael@0: class TestManyChildAllocsChild : michael@0: public PTestManyChildAllocsChild michael@0: { michael@0: public: michael@0: TestManyChildAllocsChild(); michael@0: virtual ~TestManyChildAllocsChild(); michael@0: michael@0: protected: michael@0: virtual bool RecvGo() MOZ_OVERRIDE; michael@0: virtual bool DeallocPTestManyChildAllocsSubChild(PTestManyChildAllocsSubChild* __a) MOZ_OVERRIDE; michael@0: virtual PTestManyChildAllocsSubChild* AllocPTestManyChildAllocsSubChild() MOZ_OVERRIDE; michael@0: michael@0: virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE michael@0: { michael@0: if (NormalShutdown != why) michael@0: fail("unexpected destruction!"); michael@0: QuitChild(); michael@0: } michael@0: }; michael@0: michael@0: michael@0: // do-nothing sub-protocol actors michael@0: michael@0: class TestManyChildAllocsSubParent : michael@0: public PTestManyChildAllocsSubParent michael@0: { michael@0: public: michael@0: TestManyChildAllocsSubParent() { } michael@0: virtual ~TestManyChildAllocsSubParent() { } michael@0: michael@0: protected: michael@0: virtual bool RecvHello() MOZ_OVERRIDE { return true; } michael@0: }; michael@0: michael@0: michael@0: class TestManyChildAllocsSubChild : michael@0: public PTestManyChildAllocsSubChild michael@0: { michael@0: public: michael@0: TestManyChildAllocsSubChild() { } michael@0: virtual ~TestManyChildAllocsSubChild() { } michael@0: }; michael@0: michael@0: michael@0: michael@0: } // namepsace _ipdltest michael@0: } // namespace mozilla michael@0: michael@0: michael@0: #endif // ifndef mozilla__ipdltest_TestManyChildAllocs_h