michael@0: #ifndef mozilla__ipdltest_TestRacyInterruptReplies_h michael@0: #define mozilla__ipdltest_TestRacyInterruptReplies_h 1 michael@0: michael@0: #include "mozilla/_ipdltest/IPDLUnitTests.h" michael@0: michael@0: #include "mozilla/_ipdltest/PTestRacyInterruptRepliesParent.h" michael@0: #include "mozilla/_ipdltest/PTestRacyInterruptRepliesChild.h" michael@0: michael@0: namespace mozilla { michael@0: namespace _ipdltest { michael@0: michael@0: michael@0: class TestRacyInterruptRepliesParent : michael@0: public PTestRacyInterruptRepliesParent michael@0: { michael@0: public: michael@0: TestRacyInterruptRepliesParent(); michael@0: virtual ~TestRacyInterruptRepliesParent(); 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 RecvA_() MOZ_OVERRIDE; michael@0: michael@0: virtual bool Answer_R(int* replyNum) 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: private: michael@0: int mReplyNum; michael@0: }; michael@0: michael@0: michael@0: class TestRacyInterruptRepliesChild : michael@0: public PTestRacyInterruptRepliesChild michael@0: { michael@0: public: michael@0: TestRacyInterruptRepliesChild(); michael@0: virtual ~TestRacyInterruptRepliesChild(); michael@0: michael@0: protected: michael@0: virtual bool AnswerR_(int* replyNum) MOZ_OVERRIDE; michael@0: michael@0: virtual bool RecvChildTest() MOZ_OVERRIDE; michael@0: michael@0: virtual bool Recv_A() 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: private: michael@0: int mReplyNum; michael@0: }; michael@0: michael@0: michael@0: } // namespace _ipdltest michael@0: } // namespace mozilla michael@0: michael@0: michael@0: #endif // ifndef mozilla__ipdltest_TestRacyInterruptReplies_h