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 class TestNestedLoopsParent : public PTestNestedLoopsParent {
13   friend class PTestNestedLoopsParent;
14 
15  public:
16   TestNestedLoopsParent();
17   virtual ~TestNestedLoopsParent();
18 
RunTestInProcesses()19   static bool RunTestInProcesses() { return true; }
RunTestInThreads()20   static bool RunTestInThreads() { return true; }
21 
22   void Main();
23 
24  protected:
25   mozilla::ipc::IPCResult RecvNonce();
26 
27   void BreakNestedLoop();
28 
ActorDestroy(ActorDestroyReason why)29   virtual void ActorDestroy(ActorDestroyReason why) override {
30     if (NormalShutdown != why) fail("unexpected destruction!");
31     passed("ok");
32     QuitParent();
33   }
34 
35   bool mBreakNestedLoop;
36 };
37 
38 class TestNestedLoopsChild : public PTestNestedLoopsChild {
39   friend class PTestNestedLoopsChild;
40 
41  public:
42   TestNestedLoopsChild();
43   virtual ~TestNestedLoopsChild();
44 
45  protected:
46   mozilla::ipc::IPCResult RecvStart();
47 
48   mozilla::ipc::IPCResult AnswerR();
49 
ActorDestroy(ActorDestroyReason why)50   virtual void ActorDestroy(ActorDestroyReason why) override {
51     if (NormalShutdown != why) fail("unexpected destruction!");
52     QuitChild();
53   }
54 };
55 
56 }  // namespace _ipdltest
57 }  // namespace mozilla
58 
59 #endif  // ifndef mozilla__ipdltest_TestNestedLoops_h
60