michael@0: #ifndef mozilla__ipdltest_TestActorPunning_h michael@0: #define mozilla__ipdltest_TestActorPunning_h 1 michael@0: michael@0: #include "mozilla/_ipdltest/IPDLUnitTests.h" michael@0: michael@0: #include "mozilla/_ipdltest/PTestActorPunningParent.h" michael@0: #include "mozilla/_ipdltest/PTestActorPunningPunnedParent.h" michael@0: #include "mozilla/_ipdltest/PTestActorPunningSubParent.h" michael@0: #include "mozilla/_ipdltest/PTestActorPunningChild.h" michael@0: #include "mozilla/_ipdltest/PTestActorPunningPunnedChild.h" michael@0: #include "mozilla/_ipdltest/PTestActorPunningSubChild.h" michael@0: michael@0: namespace mozilla { michael@0: namespace _ipdltest { michael@0: michael@0: michael@0: class TestActorPunningParent : michael@0: public PTestActorPunningParent michael@0: { michael@0: public: michael@0: static bool RunTestInProcesses() { return true; } michael@0: static bool RunTestInThreads() { return false; } michael@0: michael@0: void Main(); michael@0: michael@0: protected: michael@0: PTestActorPunningPunnedParent* AllocPTestActorPunningPunnedParent() MOZ_OVERRIDE; michael@0: bool DeallocPTestActorPunningPunnedParent(PTestActorPunningPunnedParent* a) MOZ_OVERRIDE; michael@0: michael@0: PTestActorPunningSubParent* AllocPTestActorPunningSubParent() MOZ_OVERRIDE; michael@0: bool DeallocPTestActorPunningSubParent(PTestActorPunningSubParent* a) MOZ_OVERRIDE; michael@0: michael@0: virtual bool RecvPun(PTestActorPunningSubParent* a, const Bad& bad) MOZ_OVERRIDE; michael@0: michael@0: virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE michael@0: { michael@0: if (NormalShutdown == why) michael@0: fail("should have died from error!"); michael@0: passed("ok"); michael@0: QuitParent(); michael@0: } michael@0: }; michael@0: michael@0: class TestActorPunningPunnedParent : michael@0: public PTestActorPunningPunnedParent michael@0: { michael@0: public: michael@0: TestActorPunningPunnedParent() {} michael@0: virtual ~TestActorPunningPunnedParent() {} michael@0: }; michael@0: michael@0: class TestActorPunningSubParent : michael@0: public PTestActorPunningSubParent michael@0: { michael@0: public: michael@0: TestActorPunningSubParent() {} michael@0: virtual ~TestActorPunningSubParent() {} michael@0: }; michael@0: michael@0: michael@0: class TestActorPunningChild : michael@0: public PTestActorPunningChild michael@0: { michael@0: public: michael@0: TestActorPunningChild() {} michael@0: virtual ~TestActorPunningChild() {} michael@0: michael@0: protected: michael@0: PTestActorPunningPunnedChild* AllocPTestActorPunningPunnedChild() MOZ_OVERRIDE; michael@0: bool DeallocPTestActorPunningPunnedChild(PTestActorPunningPunnedChild* a) MOZ_OVERRIDE; michael@0: michael@0: PTestActorPunningSubChild* AllocPTestActorPunningSubChild() MOZ_OVERRIDE; michael@0: bool DeallocPTestActorPunningSubChild(PTestActorPunningSubChild* a) MOZ_OVERRIDE; michael@0: michael@0: virtual bool RecvStart() MOZ_OVERRIDE; michael@0: michael@0: virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE michael@0: { michael@0: fail("should have been killed off!"); michael@0: } michael@0: }; michael@0: michael@0: class TestActorPunningPunnedChild : michael@0: public PTestActorPunningPunnedChild michael@0: { michael@0: public: michael@0: TestActorPunningPunnedChild() {} michael@0: virtual ~TestActorPunningPunnedChild() {} michael@0: }; michael@0: michael@0: class TestActorPunningSubChild : michael@0: public PTestActorPunningSubChild michael@0: { michael@0: public: michael@0: TestActorPunningSubChild() {} michael@0: virtual ~TestActorPunningSubChild() {} michael@0: michael@0: virtual bool RecvBad() MOZ_OVERRIDE; michael@0: }; michael@0: michael@0: michael@0: } // namespace _ipdltest michael@0: } // namespace mozilla michael@0: michael@0: michael@0: #endif // ifndef mozilla__ipdltest_TestActorPunning_h