Wed, 31 Dec 2014 13:27:57 +0100
Ignore runtime configuration files generated during quality assurance.
michael@0 | 1 | #ifndef mozilla__ipdltest_TestRaceDeferral_h |
michael@0 | 2 | #define mozilla__ipdltest_TestRaceDeferral_h 1 |
michael@0 | 3 | |
michael@0 | 4 | #include "mozilla/_ipdltest/IPDLUnitTests.h" |
michael@0 | 5 | |
michael@0 | 6 | #include "mozilla/_ipdltest/PTestRaceDeferralParent.h" |
michael@0 | 7 | #include "mozilla/_ipdltest/PTestRaceDeferralChild.h" |
michael@0 | 8 | |
michael@0 | 9 | namespace mozilla { |
michael@0 | 10 | namespace _ipdltest { |
michael@0 | 11 | |
michael@0 | 12 | class TestRaceDeferralParent : |
michael@0 | 13 | public PTestRaceDeferralParent |
michael@0 | 14 | { |
michael@0 | 15 | public: |
michael@0 | 16 | TestRaceDeferralParent(); |
michael@0 | 17 | virtual ~TestRaceDeferralParent(); |
michael@0 | 18 | |
michael@0 | 19 | static bool RunTestInProcesses() { return true; } |
michael@0 | 20 | static bool RunTestInThreads() { return true; } |
michael@0 | 21 | |
michael@0 | 22 | void Main(); |
michael@0 | 23 | |
michael@0 | 24 | protected: |
michael@0 | 25 | void Test1(); |
michael@0 | 26 | |
michael@0 | 27 | virtual bool AnswerLose() MOZ_OVERRIDE; |
michael@0 | 28 | |
michael@0 | 29 | virtual mozilla::ipc::RacyInterruptPolicy |
michael@0 | 30 | MediateInterruptRace(const Message& parent, const Message& child) MOZ_OVERRIDE; |
michael@0 | 31 | |
michael@0 | 32 | virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE |
michael@0 | 33 | { |
michael@0 | 34 | if (NormalShutdown != why) |
michael@0 | 35 | fail("unexpected destruction!"); |
michael@0 | 36 | passed("ok"); |
michael@0 | 37 | QuitParent(); |
michael@0 | 38 | } |
michael@0 | 39 | |
michael@0 | 40 | bool mProcessedLose; |
michael@0 | 41 | }; |
michael@0 | 42 | |
michael@0 | 43 | |
michael@0 | 44 | class TestRaceDeferralChild : |
michael@0 | 45 | public PTestRaceDeferralChild |
michael@0 | 46 | { |
michael@0 | 47 | public: |
michael@0 | 48 | TestRaceDeferralChild(); |
michael@0 | 49 | virtual ~TestRaceDeferralChild(); |
michael@0 | 50 | |
michael@0 | 51 | protected: |
michael@0 | 52 | virtual bool RecvStartRace() MOZ_OVERRIDE; |
michael@0 | 53 | |
michael@0 | 54 | virtual bool AnswerWin() MOZ_OVERRIDE; |
michael@0 | 55 | |
michael@0 | 56 | virtual bool AnswerRpc() MOZ_OVERRIDE; |
michael@0 | 57 | |
michael@0 | 58 | virtual mozilla::ipc::RacyInterruptPolicy |
michael@0 | 59 | MediateInterruptRace(const Message& parent, const Message& child) MOZ_OVERRIDE; |
michael@0 | 60 | |
michael@0 | 61 | virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE |
michael@0 | 62 | { |
michael@0 | 63 | if (NormalShutdown != why) |
michael@0 | 64 | fail("unexpected destruction!"); |
michael@0 | 65 | QuitChild(); |
michael@0 | 66 | } |
michael@0 | 67 | }; |
michael@0 | 68 | |
michael@0 | 69 | |
michael@0 | 70 | } // namespace _ipdltest |
michael@0 | 71 | } // namespace mozilla |
michael@0 | 72 | |
michael@0 | 73 | |
michael@0 | 74 | #endif // ifndef mozilla__ipdltest_TestRaceDeferral_h |