Wed, 31 Dec 2014 13:27:57 +0100
Ignore runtime configuration files generated during quality assurance.
michael@0 | 1 | #ifndef mozilla__ipdltest_TestBridgeMain_h |
michael@0 | 2 | #define mozilla__ipdltest_TestBridgeMain_h 1 |
michael@0 | 3 | |
michael@0 | 4 | #include "mozilla/_ipdltest/IPDLUnitTests.h" |
michael@0 | 5 | |
michael@0 | 6 | #include "mozilla/_ipdltest/PTestBridgeMainParent.h" |
michael@0 | 7 | #include "mozilla/_ipdltest/PTestBridgeMainChild.h" |
michael@0 | 8 | |
michael@0 | 9 | #include "mozilla/_ipdltest/PTestBridgeSubParent.h" |
michael@0 | 10 | #include "mozilla/_ipdltest/PTestBridgeSubChild.h" |
michael@0 | 11 | |
michael@0 | 12 | #include "mozilla/_ipdltest/PTestBridgeMainSubParent.h" |
michael@0 | 13 | #include "mozilla/_ipdltest/PTestBridgeMainSubChild.h" |
michael@0 | 14 | |
michael@0 | 15 | namespace mozilla { |
michael@0 | 16 | namespace _ipdltest { |
michael@0 | 17 | |
michael@0 | 18 | //----------------------------------------------------------------------------- |
michael@0 | 19 | // "Main" process |
michael@0 | 20 | // |
michael@0 | 21 | class TestBridgeMainParent : |
michael@0 | 22 | public PTestBridgeMainParent |
michael@0 | 23 | { |
michael@0 | 24 | public: |
michael@0 | 25 | TestBridgeMainParent() {} |
michael@0 | 26 | virtual ~TestBridgeMainParent() {} |
michael@0 | 27 | |
michael@0 | 28 | static bool RunTestInProcesses() { return true; } |
michael@0 | 29 | static bool RunTestInThreads() { return false; } |
michael@0 | 30 | |
michael@0 | 31 | void Main(); |
michael@0 | 32 | |
michael@0 | 33 | protected: |
michael@0 | 34 | virtual PTestBridgeMainSubParent* |
michael@0 | 35 | AllocPTestBridgeMainSubParent(Transport* transport, |
michael@0 | 36 | ProcessId otherProcess) MOZ_OVERRIDE; |
michael@0 | 37 | |
michael@0 | 38 | virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE; |
michael@0 | 39 | }; |
michael@0 | 40 | |
michael@0 | 41 | class TestBridgeMainSubParent : |
michael@0 | 42 | public PTestBridgeMainSubParent |
michael@0 | 43 | { |
michael@0 | 44 | public: |
michael@0 | 45 | TestBridgeMainSubParent(Transport* aTransport) |
michael@0 | 46 | : mTransport(aTransport) |
michael@0 | 47 | {} |
michael@0 | 48 | virtual ~TestBridgeMainSubParent() {} |
michael@0 | 49 | |
michael@0 | 50 | protected: |
michael@0 | 51 | virtual bool RecvHello() MOZ_OVERRIDE; |
michael@0 | 52 | virtual bool RecvHelloSync() MOZ_OVERRIDE; |
michael@0 | 53 | virtual bool AnswerHelloRpc() MOZ_OVERRIDE; |
michael@0 | 54 | |
michael@0 | 55 | virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE; |
michael@0 | 56 | |
michael@0 | 57 | Transport* mTransport; |
michael@0 | 58 | }; |
michael@0 | 59 | |
michael@0 | 60 | //----------------------------------------------------------------------------- |
michael@0 | 61 | // "Sub" process --- child of "main" |
michael@0 | 62 | // |
michael@0 | 63 | class TestBridgeSubParent; |
michael@0 | 64 | |
michael@0 | 65 | class TestBridgeMainChild : |
michael@0 | 66 | public PTestBridgeMainChild |
michael@0 | 67 | { |
michael@0 | 68 | public: |
michael@0 | 69 | TestBridgeMainChild(); |
michael@0 | 70 | virtual ~TestBridgeMainChild() {} |
michael@0 | 71 | |
michael@0 | 72 | protected: |
michael@0 | 73 | virtual bool RecvStart() MOZ_OVERRIDE; |
michael@0 | 74 | |
michael@0 | 75 | virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE; |
michael@0 | 76 | |
michael@0 | 77 | IPDLUnitTestSubprocess* mSubprocess; |
michael@0 | 78 | }; |
michael@0 | 79 | |
michael@0 | 80 | class TestBridgeSubParent : |
michael@0 | 81 | public PTestBridgeSubParent |
michael@0 | 82 | { |
michael@0 | 83 | public: |
michael@0 | 84 | TestBridgeSubParent() {} |
michael@0 | 85 | virtual ~TestBridgeSubParent() {} |
michael@0 | 86 | |
michael@0 | 87 | void Main(); |
michael@0 | 88 | |
michael@0 | 89 | protected: |
michael@0 | 90 | virtual bool RecvBridgeEm() MOZ_OVERRIDE; |
michael@0 | 91 | |
michael@0 | 92 | virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE; |
michael@0 | 93 | }; |
michael@0 | 94 | |
michael@0 | 95 | //----------------------------------------------------------------------------- |
michael@0 | 96 | // "Subsub" process --- child of "sub" |
michael@0 | 97 | // |
michael@0 | 98 | class TestBridgeSubChild : |
michael@0 | 99 | public PTestBridgeSubChild |
michael@0 | 100 | { |
michael@0 | 101 | public: |
michael@0 | 102 | TestBridgeSubChild(); |
michael@0 | 103 | virtual ~TestBridgeSubChild() {} |
michael@0 | 104 | |
michael@0 | 105 | protected: |
michael@0 | 106 | virtual bool RecvPing() MOZ_OVERRIDE; |
michael@0 | 107 | |
michael@0 | 108 | virtual PTestBridgeMainSubChild* |
michael@0 | 109 | AllocPTestBridgeMainSubChild(Transport* transport, |
michael@0 | 110 | ProcessId otherProcess) MOZ_OVERRIDE; |
michael@0 | 111 | |
michael@0 | 112 | virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE; |
michael@0 | 113 | }; |
michael@0 | 114 | |
michael@0 | 115 | class TestBridgeMainSubChild : |
michael@0 | 116 | public PTestBridgeMainSubChild |
michael@0 | 117 | { |
michael@0 | 118 | public: |
michael@0 | 119 | TestBridgeMainSubChild(Transport* aTransport) |
michael@0 | 120 | : mGotHi(false) |
michael@0 | 121 | , mTransport(aTransport) |
michael@0 | 122 | {} |
michael@0 | 123 | virtual ~TestBridgeMainSubChild() {} |
michael@0 | 124 | |
michael@0 | 125 | protected: |
michael@0 | 126 | virtual bool RecvHi() MOZ_OVERRIDE; |
michael@0 | 127 | virtual bool AnswerHiRpc() MOZ_OVERRIDE; |
michael@0 | 128 | |
michael@0 | 129 | virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE; |
michael@0 | 130 | |
michael@0 | 131 | bool mGotHi; |
michael@0 | 132 | Transport* mTransport; |
michael@0 | 133 | }; |
michael@0 | 134 | |
michael@0 | 135 | } // namespace _ipdltest |
michael@0 | 136 | } // namespace mozilla |
michael@0 | 137 | |
michael@0 | 138 | |
michael@0 | 139 | #endif // ifndef mozilla__ipdltest_TestBridgeMain_h |