Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 #ifndef mozilla__ipdltest_TestUrgency_h
2 #define mozilla__ipdltest_TestUrgency_h 1
4 #include "mozilla/_ipdltest/IPDLUnitTests.h"
6 #include "mozilla/_ipdltest/PTestUrgencyParent.h"
7 #include "mozilla/_ipdltest/PTestUrgencyChild.h"
9 namespace mozilla {
10 namespace _ipdltest {
13 class TestUrgencyParent :
14 public PTestUrgencyParent
15 {
16 public:
17 TestUrgencyParent();
18 virtual ~TestUrgencyParent();
20 static bool RunTestInProcesses() { return true; }
21 static bool RunTestInThreads() { return true; }
23 void Main();
25 bool RecvTest1(uint32_t *value);
26 bool RecvTest2();
27 bool RecvTest3(uint32_t *value);
28 bool RecvTest4_Begin();
29 bool RecvTest4_NestedSync();
30 bool RecvFinalTest_Begin();
32 bool ShouldContinueFromReplyTimeout() MOZ_OVERRIDE
33 {
34 return false;
35 }
36 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
37 {
38 if (AbnormalShutdown != why)
39 fail("unexpected destruction!");
40 passed("ok");
41 QuitParent();
42 }
44 private:
45 bool inreply_;
46 };
49 class TestUrgencyChild :
50 public PTestUrgencyChild
51 {
52 public:
53 TestUrgencyChild();
54 virtual ~TestUrgencyChild();
56 bool RecvStart();
57 bool AnswerReply1(uint32_t *reply);
58 bool AnswerReply2(uint32_t *reply);
59 bool AnswerTest4_Reenter();
60 bool AnswerFinalTest_Hang();
62 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
63 {
64 if (AbnormalShutdown != why)
65 fail("unexpected destruction!");
66 QuitChild();
67 }
69 private:
70 uint32_t test_;
71 };
74 } // namespace _ipdltest
75 } // namespace mozilla
78 #endif // ifndef mozilla__ipdltest_TestUrgency_h