michael@0: #ifndef mozilla__ipdltest_TestCrashCleanup_h michael@0: #define mozilla__ipdltest_TestCrashCleanup_h 1 michael@0: michael@0: #include "mozilla/_ipdltest/IPDLUnitTests.h" michael@0: michael@0: #include "mozilla/_ipdltest/PTestCrashCleanupParent.h" michael@0: #include "mozilla/_ipdltest/PTestCrashCleanupChild.h" michael@0: michael@0: namespace mozilla { michael@0: namespace _ipdltest { michael@0: michael@0: michael@0: class TestCrashCleanupParent : michael@0: public PTestCrashCleanupParent michael@0: { michael@0: public: michael@0: TestCrashCleanupParent(); michael@0: virtual ~TestCrashCleanupParent(); michael@0: 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: virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE michael@0: { michael@0: if (AbnormalShutdown != why) michael@0: fail("unexpected destruction!"); michael@0: mCleanedUp = true; michael@0: } michael@0: michael@0: bool mCleanedUp; michael@0: }; michael@0: michael@0: michael@0: class TestCrashCleanupChild : michael@0: public PTestCrashCleanupChild michael@0: { michael@0: public: michael@0: TestCrashCleanupChild(); michael@0: virtual ~TestCrashCleanupChild(); michael@0: michael@0: protected: michael@0: virtual bool AnswerDIEDIEDIE() MOZ_OVERRIDE; michael@0: michael@0: virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE michael@0: { michael@0: fail("should have 'crashed'!"); michael@0: } michael@0: }; michael@0: michael@0: michael@0: } // namespace _ipdltest michael@0: } // namespace mozilla michael@0: michael@0: michael@0: #endif // ifndef mozilla__ipdltest_TestCrashCleanup_h