Wed, 31 Dec 2014 13:27:57 +0100
Ignore runtime configuration files generated during quality assurance.
michael@0 | 1 | #ifndef mozilla__ipdltest_TestCrashCleanup_h |
michael@0 | 2 | #define mozilla__ipdltest_TestCrashCleanup_h 1 |
michael@0 | 3 | |
michael@0 | 4 | #include "mozilla/_ipdltest/IPDLUnitTests.h" |
michael@0 | 5 | |
michael@0 | 6 | #include "mozilla/_ipdltest/PTestCrashCleanupParent.h" |
michael@0 | 7 | #include "mozilla/_ipdltest/PTestCrashCleanupChild.h" |
michael@0 | 8 | |
michael@0 | 9 | namespace mozilla { |
michael@0 | 10 | namespace _ipdltest { |
michael@0 | 11 | |
michael@0 | 12 | |
michael@0 | 13 | class TestCrashCleanupParent : |
michael@0 | 14 | public PTestCrashCleanupParent |
michael@0 | 15 | { |
michael@0 | 16 | public: |
michael@0 | 17 | TestCrashCleanupParent(); |
michael@0 | 18 | virtual ~TestCrashCleanupParent(); |
michael@0 | 19 | |
michael@0 | 20 | static bool RunTestInProcesses() { return true; } |
michael@0 | 21 | static bool RunTestInThreads() { return false; } |
michael@0 | 22 | |
michael@0 | 23 | void Main(); |
michael@0 | 24 | |
michael@0 | 25 | protected: |
michael@0 | 26 | virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE |
michael@0 | 27 | { |
michael@0 | 28 | if (AbnormalShutdown != why) |
michael@0 | 29 | fail("unexpected destruction!"); |
michael@0 | 30 | mCleanedUp = true; |
michael@0 | 31 | } |
michael@0 | 32 | |
michael@0 | 33 | bool mCleanedUp; |
michael@0 | 34 | }; |
michael@0 | 35 | |
michael@0 | 36 | |
michael@0 | 37 | class TestCrashCleanupChild : |
michael@0 | 38 | public PTestCrashCleanupChild |
michael@0 | 39 | { |
michael@0 | 40 | public: |
michael@0 | 41 | TestCrashCleanupChild(); |
michael@0 | 42 | virtual ~TestCrashCleanupChild(); |
michael@0 | 43 | |
michael@0 | 44 | protected: |
michael@0 | 45 | virtual bool AnswerDIEDIEDIE() MOZ_OVERRIDE; |
michael@0 | 46 | |
michael@0 | 47 | virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE |
michael@0 | 48 | { |
michael@0 | 49 | fail("should have 'crashed'!"); |
michael@0 | 50 | } |
michael@0 | 51 | }; |
michael@0 | 52 | |
michael@0 | 53 | |
michael@0 | 54 | } // namespace _ipdltest |
michael@0 | 55 | } // namespace mozilla |
michael@0 | 56 | |
michael@0 | 57 | |
michael@0 | 58 | #endif // ifndef mozilla__ipdltest_TestCrashCleanup_h |