ipc/ipdl/test/cxx/TestRacyInterruptReplies.h

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

michael@0 1 #ifndef mozilla__ipdltest_TestRacyInterruptReplies_h
michael@0 2 #define mozilla__ipdltest_TestRacyInterruptReplies_h 1
michael@0 3
michael@0 4 #include "mozilla/_ipdltest/IPDLUnitTests.h"
michael@0 5
michael@0 6 #include "mozilla/_ipdltest/PTestRacyInterruptRepliesParent.h"
michael@0 7 #include "mozilla/_ipdltest/PTestRacyInterruptRepliesChild.h"
michael@0 8
michael@0 9 namespace mozilla {
michael@0 10 namespace _ipdltest {
michael@0 11
michael@0 12
michael@0 13 class TestRacyInterruptRepliesParent :
michael@0 14 public PTestRacyInterruptRepliesParent
michael@0 15 {
michael@0 16 public:
michael@0 17 TestRacyInterruptRepliesParent();
michael@0 18 virtual ~TestRacyInterruptRepliesParent();
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 RecvA_() MOZ_OVERRIDE;
michael@0 27
michael@0 28 virtual bool Answer_R(int* replyNum) MOZ_OVERRIDE;
michael@0 29
michael@0 30 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
michael@0 31 {
michael@0 32 if (NormalShutdown != why)
michael@0 33 fail("unexpected destruction!");
michael@0 34 passed("ok");
michael@0 35 QuitParent();
michael@0 36 }
michael@0 37
michael@0 38 private:
michael@0 39 int mReplyNum;
michael@0 40 };
michael@0 41
michael@0 42
michael@0 43 class TestRacyInterruptRepliesChild :
michael@0 44 public PTestRacyInterruptRepliesChild
michael@0 45 {
michael@0 46 public:
michael@0 47 TestRacyInterruptRepliesChild();
michael@0 48 virtual ~TestRacyInterruptRepliesChild();
michael@0 49
michael@0 50 protected:
michael@0 51 virtual bool AnswerR_(int* replyNum) MOZ_OVERRIDE;
michael@0 52
michael@0 53 virtual bool RecvChildTest() MOZ_OVERRIDE;
michael@0 54
michael@0 55 virtual bool Recv_A() MOZ_OVERRIDE;
michael@0 56
michael@0 57 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
michael@0 58 {
michael@0 59 if (NormalShutdown != why)
michael@0 60 fail("unexpected destruction!");
michael@0 61 QuitChild();
michael@0 62 }
michael@0 63
michael@0 64 private:
michael@0 65 int mReplyNum;
michael@0 66 };
michael@0 67
michael@0 68
michael@0 69 } // namespace _ipdltest
michael@0 70 } // namespace mozilla
michael@0 71
michael@0 72
michael@0 73 #endif // ifndef mozilla__ipdltest_TestRacyInterruptReplies_h

mercurial