Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | #ifndef mozilla__ipdltest_TestRacyReentry_h |
michael@0 | 2 | #define mozilla__ipdltest_TestRacyReentry_h 1 |
michael@0 | 3 | |
michael@0 | 4 | #include "mozilla/_ipdltest/IPDLUnitTests.h" |
michael@0 | 5 | |
michael@0 | 6 | #include "mozilla/_ipdltest/PTestRacyReentryParent.h" |
michael@0 | 7 | #include "mozilla/_ipdltest/PTestRacyReentryChild.h" |
michael@0 | 8 | |
michael@0 | 9 | namespace mozilla { |
michael@0 | 10 | namespace _ipdltest { |
michael@0 | 11 | |
michael@0 | 12 | |
michael@0 | 13 | class TestRacyReentryParent : |
michael@0 | 14 | public PTestRacyReentryParent |
michael@0 | 15 | { |
michael@0 | 16 | public: |
michael@0 | 17 | TestRacyReentryParent(); |
michael@0 | 18 | virtual ~TestRacyReentryParent(); |
michael@0 | 19 | |
michael@0 | 20 | static bool RunTestInProcesses() { return true; } |
michael@0 | 21 | static bool RunTestInThreads() { return true; } |
michael@0 | 22 | |
michael@0 | 23 | void Main(); |
michael@0 | 24 | |
michael@0 | 25 | protected: |
michael@0 | 26 | virtual bool AnswerE() MOZ_OVERRIDE; |
michael@0 | 27 | |
michael@0 | 28 | virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE |
michael@0 | 29 | { |
michael@0 | 30 | if (NormalShutdown != why) |
michael@0 | 31 | fail("unexpected destruction!"); |
michael@0 | 32 | passed("ok"); |
michael@0 | 33 | QuitParent(); |
michael@0 | 34 | } |
michael@0 | 35 | |
michael@0 | 36 | bool mRecvdE; |
michael@0 | 37 | }; |
michael@0 | 38 | |
michael@0 | 39 | |
michael@0 | 40 | class TestRacyReentryChild : |
michael@0 | 41 | public PTestRacyReentryChild |
michael@0 | 42 | { |
michael@0 | 43 | public: |
michael@0 | 44 | TestRacyReentryChild(); |
michael@0 | 45 | virtual ~TestRacyReentryChild(); |
michael@0 | 46 | |
michael@0 | 47 | protected: |
michael@0 | 48 | virtual bool RecvStart() MOZ_OVERRIDE; |
michael@0 | 49 | |
michael@0 | 50 | virtual bool RecvN() MOZ_OVERRIDE; |
michael@0 | 51 | |
michael@0 | 52 | virtual bool AnswerH() MOZ_OVERRIDE; |
michael@0 | 53 | |
michael@0 | 54 | virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE |
michael@0 | 55 | { |
michael@0 | 56 | if (NormalShutdown != why) |
michael@0 | 57 | fail("unexpected destruction!"); |
michael@0 | 58 | QuitChild(); |
michael@0 | 59 | } |
michael@0 | 60 | }; |
michael@0 | 61 | |
michael@0 | 62 | |
michael@0 | 63 | } // namespace _ipdltest |
michael@0 | 64 | } // namespace mozilla |
michael@0 | 65 | |
michael@0 | 66 | |
michael@0 | 67 | #endif // ifndef mozilla__ipdltest_TestRacyReentry_h |