michael@0: #ifndef mozilla__ipdltest_TestSysVShmem_h michael@0: #define mozilla__ipdltest_TestSysVShmem_h michael@0: michael@0: #include "mozilla/_ipdltest/IPDLUnitTests.h" michael@0: michael@0: #include "mozilla/_ipdltest/PTestSysVShmemParent.h" michael@0: #include "mozilla/_ipdltest/PTestSysVShmemChild.h" michael@0: michael@0: namespace mozilla { michael@0: namespace _ipdltest { michael@0: michael@0: michael@0: class TestSysVShmemParent : michael@0: public PTestSysVShmemParent michael@0: { michael@0: public: michael@0: TestSysVShmemParent() { } michael@0: virtual ~TestSysVShmemParent() { } 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 RecvTake( michael@0: Shmem& mem, michael@0: Shmem& unsafe, michael@0: const size_t& expectedSize) 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 TestSysVShmemChild : michael@0: public PTestSysVShmemChild michael@0: { michael@0: public: michael@0: TestSysVShmemChild() { } michael@0: virtual ~TestSysVShmemChild() { } michael@0: michael@0: protected: michael@0: virtual bool RecvGive( michael@0: Shmem& mem, michael@0: Shmem& unsafe, michael@0: const size_t& expectedSize) 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: } // namespace _ipdltest michael@0: } // namespace mozilla michael@0: michael@0: #endif // ifndef mozilla__ipdltest_TestSysVShmem_h