ipc/ipdl/test/cxx/TestSyncWakeup.h

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:bb02933ac38f
1 #ifndef mozilla__ipdltest_TestSyncWakeup_h
2 #define mozilla__ipdltest_TestSyncWakeup_h 1
3
4 #include "mozilla/_ipdltest/IPDLUnitTests.h"
5
6 #include "mozilla/_ipdltest/PTestSyncWakeupParent.h"
7 #include "mozilla/_ipdltest/PTestSyncWakeupChild.h"
8
9 namespace mozilla {
10 namespace _ipdltest {
11
12
13 class TestSyncWakeupParent :
14 public PTestSyncWakeupParent
15 {
16 public:
17 TestSyncWakeupParent();
18 virtual ~TestSyncWakeupParent();
19
20 static bool RunTestInProcesses() { return true; }
21 static bool RunTestInThreads() { return true; }
22
23 void Main();
24
25 protected:
26 virtual bool AnswerStackFrame() MOZ_OVERRIDE;
27
28 virtual bool RecvSync1() MOZ_OVERRIDE;
29
30 virtual bool RecvSync2() MOZ_OVERRIDE;
31
32 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
33 {
34 if (NormalShutdown != why)
35 fail("unexpected destruction!");
36 passed("ok");
37 QuitParent();
38 }
39 };
40
41
42 class TestSyncWakeupChild :
43 public PTestSyncWakeupChild
44 {
45 public:
46 TestSyncWakeupChild();
47 virtual ~TestSyncWakeupChild();
48
49 protected:
50 virtual bool RecvStart() MOZ_OVERRIDE;
51
52 virtual bool RecvNote1() MOZ_OVERRIDE;
53
54 virtual bool AnswerStackFrame() MOZ_OVERRIDE;
55
56 virtual bool RecvNote2() MOZ_OVERRIDE;
57
58 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
59 {
60 if (NormalShutdown != why)
61 fail("unexpected destruction!");
62 QuitChild();
63 }
64
65 private:
66 bool mDone;
67 };
68
69
70 } // namespace _ipdltest
71 } // namespace mozilla
72
73
74 #endif // ifndef mozilla__ipdltest_TestSyncWakeup_h

mercurial