ipc/ipdl/test/cxx/TestRacyReentry.h

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

mercurial