ipc/ipdl/test/cxx/TestInterruptShutdownRace.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 #ifndef mozilla__ipdltest_TestInterruptShutdownRace_h
michael@0 2 #define mozilla__ipdltest_TestInterruptShutdownRace_h 1
michael@0 3
michael@0 4 #include "mozilla/_ipdltest/IPDLUnitTests.h"
michael@0 5
michael@0 6 #include "mozilla/_ipdltest/PTestInterruptShutdownRaceParent.h"
michael@0 7 #include "mozilla/_ipdltest/PTestInterruptShutdownRaceChild.h"
michael@0 8
michael@0 9 namespace mozilla {
michael@0 10 namespace _ipdltest {
michael@0 11
michael@0 12
michael@0 13 class TestInterruptShutdownRaceParent :
michael@0 14 public PTestInterruptShutdownRaceParent
michael@0 15 {
michael@0 16 public:
michael@0 17 TestInterruptShutdownRaceParent();
michael@0 18 virtual ~TestInterruptShutdownRaceParent();
michael@0 19
michael@0 20 static bool RunTestInProcesses() { return true; }
michael@0 21 // FIXME/bug 703323 Could work if modified
michael@0 22 static bool RunTestInThreads() { return false; }
michael@0 23
michael@0 24 void Main();
michael@0 25
michael@0 26 virtual bool RecvStartDeath() MOZ_OVERRIDE;
michael@0 27
michael@0 28 virtual bool RecvOrphan() MOZ_OVERRIDE;
michael@0 29
michael@0 30 protected:
michael@0 31 void StartShuttingDown();
michael@0 32
michael@0 33 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
michael@0 34 {
michael@0 35 if (AbnormalShutdown != why)
michael@0 36 fail("unexpected destruction!");
michael@0 37 }
michael@0 38 };
michael@0 39
michael@0 40
michael@0 41 class TestInterruptShutdownRaceChild :
michael@0 42 public PTestInterruptShutdownRaceChild
michael@0 43 {
michael@0 44 public:
michael@0 45 TestInterruptShutdownRaceChild();
michael@0 46 virtual ~TestInterruptShutdownRaceChild();
michael@0 47
michael@0 48 protected:
michael@0 49 virtual bool RecvStart() MOZ_OVERRIDE;
michael@0 50
michael@0 51 virtual bool AnswerExit() MOZ_OVERRIDE;
michael@0 52
michael@0 53 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
michael@0 54 {
michael@0 55 fail("should have 'crashed'!");
michael@0 56 }
michael@0 57 };
michael@0 58
michael@0 59
michael@0 60 } // namespace _ipdltest
michael@0 61 } // namespace mozilla
michael@0 62
michael@0 63
michael@0 64 #endif // ifndef mozilla__ipdltest_TestInterruptShutdownRace_h

mercurial