|
1 #ifndef mozilla__ipdltest_TestManyChildAllocs_h |
|
2 #define mozilla__ipdltest_TestManyChildAllocs_h 1 |
|
3 |
|
4 #include "mozilla/_ipdltest/IPDLUnitTests.h" |
|
5 |
|
6 #include "mozilla/_ipdltest/PTestManyChildAllocsParent.h" |
|
7 #include "mozilla/_ipdltest/PTestManyChildAllocsChild.h" |
|
8 |
|
9 #include "mozilla/_ipdltest/PTestManyChildAllocsSubParent.h" |
|
10 #include "mozilla/_ipdltest/PTestManyChildAllocsSubChild.h" |
|
11 |
|
12 namespace mozilla { |
|
13 namespace _ipdltest { |
|
14 |
|
15 // top-level protocol |
|
16 |
|
17 class TestManyChildAllocsParent : |
|
18 public PTestManyChildAllocsParent |
|
19 { |
|
20 public: |
|
21 TestManyChildAllocsParent(); |
|
22 virtual ~TestManyChildAllocsParent(); |
|
23 |
|
24 static bool RunTestInProcesses() { return true; } |
|
25 static bool RunTestInThreads() { return true; } |
|
26 |
|
27 void Main(); |
|
28 |
|
29 protected: |
|
30 virtual bool RecvDone() MOZ_OVERRIDE; |
|
31 virtual bool DeallocPTestManyChildAllocsSubParent(PTestManyChildAllocsSubParent* __a) MOZ_OVERRIDE; |
|
32 virtual PTestManyChildAllocsSubParent* AllocPTestManyChildAllocsSubParent() MOZ_OVERRIDE; |
|
33 |
|
34 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE |
|
35 { |
|
36 if (NormalShutdown != why) |
|
37 fail("unexpected destruction!"); |
|
38 passed("ok"); |
|
39 QuitParent(); |
|
40 } |
|
41 }; |
|
42 |
|
43 |
|
44 class TestManyChildAllocsChild : |
|
45 public PTestManyChildAllocsChild |
|
46 { |
|
47 public: |
|
48 TestManyChildAllocsChild(); |
|
49 virtual ~TestManyChildAllocsChild(); |
|
50 |
|
51 protected: |
|
52 virtual bool RecvGo() MOZ_OVERRIDE; |
|
53 virtual bool DeallocPTestManyChildAllocsSubChild(PTestManyChildAllocsSubChild* __a) MOZ_OVERRIDE; |
|
54 virtual PTestManyChildAllocsSubChild* AllocPTestManyChildAllocsSubChild() MOZ_OVERRIDE; |
|
55 |
|
56 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE |
|
57 { |
|
58 if (NormalShutdown != why) |
|
59 fail("unexpected destruction!"); |
|
60 QuitChild(); |
|
61 } |
|
62 }; |
|
63 |
|
64 |
|
65 // do-nothing sub-protocol actors |
|
66 |
|
67 class TestManyChildAllocsSubParent : |
|
68 public PTestManyChildAllocsSubParent |
|
69 { |
|
70 public: |
|
71 TestManyChildAllocsSubParent() { } |
|
72 virtual ~TestManyChildAllocsSubParent() { } |
|
73 |
|
74 protected: |
|
75 virtual bool RecvHello() MOZ_OVERRIDE { return true; } |
|
76 }; |
|
77 |
|
78 |
|
79 class TestManyChildAllocsSubChild : |
|
80 public PTestManyChildAllocsSubChild |
|
81 { |
|
82 public: |
|
83 TestManyChildAllocsSubChild() { } |
|
84 virtual ~TestManyChildAllocsSubChild() { } |
|
85 }; |
|
86 |
|
87 |
|
88 |
|
89 } // namepsace _ipdltest |
|
90 } // namespace mozilla |
|
91 |
|
92 |
|
93 #endif // ifndef mozilla__ipdltest_TestManyChildAllocs_h |