1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/ipc/ipdl/test/cxx/TestNestedLoops.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,67 @@ 1.4 +#ifndef mozilla__ipdltest_TestNestedLoops_h 1.5 +#define mozilla__ipdltest_TestNestedLoops_h 1 1.6 + 1.7 +#include "mozilla/_ipdltest/IPDLUnitTests.h" 1.8 + 1.9 +#include "mozilla/_ipdltest/PTestNestedLoopsParent.h" 1.10 +#include "mozilla/_ipdltest/PTestNestedLoopsChild.h" 1.11 + 1.12 +namespace mozilla { 1.13 +namespace _ipdltest { 1.14 + 1.15 + 1.16 +class TestNestedLoopsParent : 1.17 + public PTestNestedLoopsParent 1.18 +{ 1.19 +public: 1.20 + TestNestedLoopsParent(); 1.21 + virtual ~TestNestedLoopsParent(); 1.22 + 1.23 + static bool RunTestInProcesses() { return true; } 1.24 + static bool RunTestInThreads() { return true; } 1.25 + 1.26 + void Main(); 1.27 + 1.28 +protected: 1.29 + virtual bool RecvNonce() MOZ_OVERRIDE; 1.30 + 1.31 + void BreakNestedLoop(); 1.32 + 1.33 + virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE 1.34 + { 1.35 + if (NormalShutdown != why) 1.36 + fail("unexpected destruction!"); 1.37 + passed("ok"); 1.38 + QuitParent(); 1.39 + } 1.40 + 1.41 + bool mBreakNestedLoop; 1.42 +}; 1.43 + 1.44 + 1.45 +class TestNestedLoopsChild : 1.46 + public PTestNestedLoopsChild 1.47 +{ 1.48 +public: 1.49 + TestNestedLoopsChild(); 1.50 + virtual ~TestNestedLoopsChild(); 1.51 + 1.52 +protected: 1.53 + virtual bool RecvStart() MOZ_OVERRIDE; 1.54 + 1.55 + virtual bool AnswerR() MOZ_OVERRIDE; 1.56 + 1.57 + virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE 1.58 + { 1.59 + if (NormalShutdown != why) 1.60 + fail("unexpected destruction!"); 1.61 + QuitChild(); 1.62 + } 1.63 +}; 1.64 + 1.65 + 1.66 +} // namespace _ipdltest 1.67 +} // namespace mozilla 1.68 + 1.69 + 1.70 +#endif // ifndef mozilla__ipdltest_TestNestedLoops_h