|
1 #ifndef mozilla__ipdltest_TestUrgency_h |
|
2 #define mozilla__ipdltest_TestUrgency_h 1 |
|
3 |
|
4 #include "mozilla/_ipdltest/IPDLUnitTests.h" |
|
5 |
|
6 #include "mozilla/_ipdltest/PTestUrgencyParent.h" |
|
7 #include "mozilla/_ipdltest/PTestUrgencyChild.h" |
|
8 |
|
9 namespace mozilla { |
|
10 namespace _ipdltest { |
|
11 |
|
12 |
|
13 class TestUrgencyParent : |
|
14 public PTestUrgencyParent |
|
15 { |
|
16 public: |
|
17 TestUrgencyParent(); |
|
18 virtual ~TestUrgencyParent(); |
|
19 |
|
20 static bool RunTestInProcesses() { return true; } |
|
21 static bool RunTestInThreads() { return true; } |
|
22 |
|
23 void Main(); |
|
24 |
|
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(); |
|
31 |
|
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 } |
|
43 |
|
44 private: |
|
45 bool inreply_; |
|
46 }; |
|
47 |
|
48 |
|
49 class TestUrgencyChild : |
|
50 public PTestUrgencyChild |
|
51 { |
|
52 public: |
|
53 TestUrgencyChild(); |
|
54 virtual ~TestUrgencyChild(); |
|
55 |
|
56 bool RecvStart(); |
|
57 bool AnswerReply1(uint32_t *reply); |
|
58 bool AnswerReply2(uint32_t *reply); |
|
59 bool AnswerTest4_Reenter(); |
|
60 bool AnswerFinalTest_Hang(); |
|
61 |
|
62 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE |
|
63 { |
|
64 if (AbnormalShutdown != why) |
|
65 fail("unexpected destruction!"); |
|
66 QuitChild(); |
|
67 } |
|
68 |
|
69 private: |
|
70 uint32_t test_; |
|
71 }; |
|
72 |
|
73 |
|
74 } // namespace _ipdltest |
|
75 } // namespace mozilla |
|
76 |
|
77 |
|
78 #endif // ifndef mozilla__ipdltest_TestUrgency_h |