ipc/ipdl/test/cxx/TestUrgency.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_TestUrgency_h
michael@0 2 #define mozilla__ipdltest_TestUrgency_h 1
michael@0 3
michael@0 4 #include "mozilla/_ipdltest/IPDLUnitTests.h"
michael@0 5
michael@0 6 #include "mozilla/_ipdltest/PTestUrgencyParent.h"
michael@0 7 #include "mozilla/_ipdltest/PTestUrgencyChild.h"
michael@0 8
michael@0 9 namespace mozilla {
michael@0 10 namespace _ipdltest {
michael@0 11
michael@0 12
michael@0 13 class TestUrgencyParent :
michael@0 14 public PTestUrgencyParent
michael@0 15 {
michael@0 16 public:
michael@0 17 TestUrgencyParent();
michael@0 18 virtual ~TestUrgencyParent();
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 bool RecvTest1(uint32_t *value);
michael@0 26 bool RecvTest2();
michael@0 27 bool RecvTest3(uint32_t *value);
michael@0 28 bool RecvTest4_Begin();
michael@0 29 bool RecvTest4_NestedSync();
michael@0 30 bool RecvFinalTest_Begin();
michael@0 31
michael@0 32 bool ShouldContinueFromReplyTimeout() MOZ_OVERRIDE
michael@0 33 {
michael@0 34 return false;
michael@0 35 }
michael@0 36 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
michael@0 37 {
michael@0 38 if (AbnormalShutdown != why)
michael@0 39 fail("unexpected destruction!");
michael@0 40 passed("ok");
michael@0 41 QuitParent();
michael@0 42 }
michael@0 43
michael@0 44 private:
michael@0 45 bool inreply_;
michael@0 46 };
michael@0 47
michael@0 48
michael@0 49 class TestUrgencyChild :
michael@0 50 public PTestUrgencyChild
michael@0 51 {
michael@0 52 public:
michael@0 53 TestUrgencyChild();
michael@0 54 virtual ~TestUrgencyChild();
michael@0 55
michael@0 56 bool RecvStart();
michael@0 57 bool AnswerReply1(uint32_t *reply);
michael@0 58 bool AnswerReply2(uint32_t *reply);
michael@0 59 bool AnswerTest4_Reenter();
michael@0 60 bool AnswerFinalTest_Hang();
michael@0 61
michael@0 62 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
michael@0 63 {
michael@0 64 if (AbnormalShutdown != why)
michael@0 65 fail("unexpected destruction!");
michael@0 66 QuitChild();
michael@0 67 }
michael@0 68
michael@0 69 private:
michael@0 70 uint32_t test_;
michael@0 71 };
michael@0 72
michael@0 73
michael@0 74 } // namespace _ipdltest
michael@0 75 } // namespace mozilla
michael@0 76
michael@0 77
michael@0 78 #endif // ifndef mozilla__ipdltest_TestUrgency_h

mercurial