ipc/ipdl/test/cxx/TestNestedLoops.h

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:20988d5b3bd1
1 #ifndef mozilla__ipdltest_TestNestedLoops_h
2 #define mozilla__ipdltest_TestNestedLoops_h 1
3
4 #include "mozilla/_ipdltest/IPDLUnitTests.h"
5
6 #include "mozilla/_ipdltest/PTestNestedLoopsParent.h"
7 #include "mozilla/_ipdltest/PTestNestedLoopsChild.h"
8
9 namespace mozilla {
10 namespace _ipdltest {
11
12
13 class TestNestedLoopsParent :
14 public PTestNestedLoopsParent
15 {
16 public:
17 TestNestedLoopsParent();
18 virtual ~TestNestedLoopsParent();
19
20 static bool RunTestInProcesses() { return true; }
21 static bool RunTestInThreads() { return true; }
22
23 void Main();
24
25 protected:
26 virtual bool RecvNonce() MOZ_OVERRIDE;
27
28 void BreakNestedLoop();
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 bool mBreakNestedLoop;
39 };
40
41
42 class TestNestedLoopsChild :
43 public PTestNestedLoopsChild
44 {
45 public:
46 TestNestedLoopsChild();
47 virtual ~TestNestedLoopsChild();
48
49 protected:
50 virtual bool RecvStart() MOZ_OVERRIDE;
51
52 virtual bool AnswerR() 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_TestNestedLoops_h

mercurial