Wed, 31 Dec 2014 13:27:57 +0100
Ignore runtime configuration files generated during quality assurance.
michael@0 | 1 | #ifndef mozilla_ipdltest_TestDesc_h |
michael@0 | 2 | #define mozilla_ipdltest_TestDesc_h |
michael@0 | 3 | |
michael@0 | 4 | #include "mozilla/_ipdltest/IPDLUnitTests.h" |
michael@0 | 5 | |
michael@0 | 6 | #include "mozilla/_ipdltest/PTestDescParent.h" |
michael@0 | 7 | #include "mozilla/_ipdltest/PTestDescChild.h" |
michael@0 | 8 | |
michael@0 | 9 | #include "mozilla/_ipdltest/PTestDescSubParent.h" |
michael@0 | 10 | #include "mozilla/_ipdltest/PTestDescSubChild.h" |
michael@0 | 11 | |
michael@0 | 12 | #include "mozilla/_ipdltest/PTestDescSubsubParent.h" |
michael@0 | 13 | #include "mozilla/_ipdltest/PTestDescSubsubChild.h" |
michael@0 | 14 | |
michael@0 | 15 | namespace mozilla { |
michael@0 | 16 | namespace _ipdltest { |
michael@0 | 17 | |
michael@0 | 18 | //----------------------------------------------------------------------------- |
michael@0 | 19 | // Top-level |
michael@0 | 20 | // |
michael@0 | 21 | class TestDescParent : |
michael@0 | 22 | public PTestDescParent |
michael@0 | 23 | { |
michael@0 | 24 | public: |
michael@0 | 25 | TestDescParent() { } |
michael@0 | 26 | virtual ~TestDescParent() { } |
michael@0 | 27 | |
michael@0 | 28 | static bool RunTestInProcesses() { return true; } |
michael@0 | 29 | static bool RunTestInThreads() { return true; } |
michael@0 | 30 | |
michael@0 | 31 | void Main(); |
michael@0 | 32 | |
michael@0 | 33 | virtual bool RecvOk(PTestDescSubsubParent* a) MOZ_OVERRIDE; |
michael@0 | 34 | |
michael@0 | 35 | protected: |
michael@0 | 36 | virtual PTestDescSubParent* AllocPTestDescSubParent(PTestDescSubsubParent*) MOZ_OVERRIDE; |
michael@0 | 37 | virtual bool DeallocPTestDescSubParent(PTestDescSubParent* actor) MOZ_OVERRIDE; |
michael@0 | 38 | |
michael@0 | 39 | virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE |
michael@0 | 40 | { |
michael@0 | 41 | if (NormalShutdown != why) |
michael@0 | 42 | fail("unexpected destruction!"); |
michael@0 | 43 | passed("ok"); |
michael@0 | 44 | QuitParent(); |
michael@0 | 45 | } |
michael@0 | 46 | }; |
michael@0 | 47 | |
michael@0 | 48 | |
michael@0 | 49 | class TestDescChild : |
michael@0 | 50 | public PTestDescChild |
michael@0 | 51 | { |
michael@0 | 52 | public: |
michael@0 | 53 | TestDescChild() { } |
michael@0 | 54 | virtual ~TestDescChild() { } |
michael@0 | 55 | |
michael@0 | 56 | protected: |
michael@0 | 57 | virtual PTestDescSubChild* AllocPTestDescSubChild(PTestDescSubsubChild*) MOZ_OVERRIDE; |
michael@0 | 58 | |
michael@0 | 59 | virtual bool DeallocPTestDescSubChild(PTestDescSubChild* actor) MOZ_OVERRIDE; |
michael@0 | 60 | |
michael@0 | 61 | virtual bool RecvTest(PTestDescSubsubChild* a) MOZ_OVERRIDE; |
michael@0 | 62 | |
michael@0 | 63 | virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE |
michael@0 | 64 | { |
michael@0 | 65 | if (NormalShutdown != why) |
michael@0 | 66 | fail("unexpected destruction!"); |
michael@0 | 67 | QuitChild(); |
michael@0 | 68 | } |
michael@0 | 69 | }; |
michael@0 | 70 | |
michael@0 | 71 | |
michael@0 | 72 | //----------------------------------------------------------------------------- |
michael@0 | 73 | // First descendent |
michael@0 | 74 | // |
michael@0 | 75 | class TestDescSubParent : |
michael@0 | 76 | public PTestDescSubParent |
michael@0 | 77 | { |
michael@0 | 78 | public: |
michael@0 | 79 | TestDescSubParent() { } |
michael@0 | 80 | virtual ~TestDescSubParent() { } |
michael@0 | 81 | |
michael@0 | 82 | protected: |
michael@0 | 83 | virtual PTestDescSubsubParent* AllocPTestDescSubsubParent() MOZ_OVERRIDE; |
michael@0 | 84 | |
michael@0 | 85 | virtual bool DeallocPTestDescSubsubParent(PTestDescSubsubParent* actor) MOZ_OVERRIDE; |
michael@0 | 86 | }; |
michael@0 | 87 | |
michael@0 | 88 | |
michael@0 | 89 | class TestDescSubChild : |
michael@0 | 90 | public PTestDescSubChild |
michael@0 | 91 | { |
michael@0 | 92 | public: |
michael@0 | 93 | TestDescSubChild() { } |
michael@0 | 94 | virtual ~TestDescSubChild() { } |
michael@0 | 95 | |
michael@0 | 96 | protected: |
michael@0 | 97 | virtual PTestDescSubsubChild* AllocPTestDescSubsubChild() MOZ_OVERRIDE; |
michael@0 | 98 | virtual bool DeallocPTestDescSubsubChild(PTestDescSubsubChild* actor) MOZ_OVERRIDE; |
michael@0 | 99 | }; |
michael@0 | 100 | |
michael@0 | 101 | |
michael@0 | 102 | //----------------------------------------------------------------------------- |
michael@0 | 103 | // Grand-descendent |
michael@0 | 104 | // |
michael@0 | 105 | class TestDescSubsubParent : |
michael@0 | 106 | public PTestDescSubsubParent |
michael@0 | 107 | { |
michael@0 | 108 | public: |
michael@0 | 109 | TestDescSubsubParent() { } |
michael@0 | 110 | virtual ~TestDescSubsubParent() { } |
michael@0 | 111 | }; |
michael@0 | 112 | |
michael@0 | 113 | class TestDescSubsubChild : |
michael@0 | 114 | public PTestDescSubsubChild |
michael@0 | 115 | { |
michael@0 | 116 | public: |
michael@0 | 117 | TestDescSubsubChild() { } |
michael@0 | 118 | virtual ~TestDescSubsubChild() { } |
michael@0 | 119 | }; |
michael@0 | 120 | |
michael@0 | 121 | |
michael@0 | 122 | } |
michael@0 | 123 | } |
michael@0 | 124 | |
michael@0 | 125 | #endif // ifndef mozilla_ipdltest_TestDesc_h |