ipc/ipdl/test/cxx/TestSanity.h

branch
TOR_BUG_3246
changeset 6
8bccb770b82d
equal deleted inserted replaced
-1:000000000000 0:f5af0dfd01a8
1 #ifndef mozilla__ipdltest_TestSanity_h
2 #define mozilla__ipdltest_TestSanity_h 1
3
4 #include "mozilla/_ipdltest/IPDLUnitTests.h"
5
6 #include "mozilla/_ipdltest/PTestSanityParent.h"
7 #include "mozilla/_ipdltest/PTestSanityChild.h"
8
9 namespace mozilla {
10 namespace _ipdltest {
11
12
13 class TestSanityParent :
14 public PTestSanityParent
15 {
16 public:
17 TestSanityParent();
18 virtual ~TestSanityParent();
19
20 static bool RunTestInProcesses() { return true; }
21 static bool RunTestInThreads() { return true; }
22
23 void Main();
24
25 protected:
26 virtual bool RecvPong(const int& one, const float& zeroPtTwoFive,
27 const uint8_t& dummy) MOZ_OVERRIDE;
28
29 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
30 {
31 if (NormalShutdown != why)
32 fail("unexpected destruction!");
33 passed("ok");
34 QuitParent();
35 }
36 };
37
38
39 class TestSanityChild :
40 public PTestSanityChild
41 {
42 public:
43 TestSanityChild();
44 virtual ~TestSanityChild();
45
46 protected:
47 virtual bool RecvPing(const int& zero, const float& zeroPtFive,
48 const int8_t& dummy) MOZ_OVERRIDE;
49
50 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
51 {
52 if (NormalShutdown != why)
53 fail("unexpected destruction!");
54 QuitChild();
55 }
56 };
57
58
59 } // namespace _ipdltest
60 } // namespace mozilla
61
62
63 #endif // ifndef mozilla__ipdltest_TestSanity_h

mercurial