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