ipc/ipdl/test/cxx/TestMultiMgrs.h

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

michael@0 1 #ifndef mozilla__ipdltest_TestMultiMgrs_h
michael@0 2 #define mozilla__ipdltest_TestMultiMgrs_h 1
michael@0 3
michael@0 4 #include "mozilla/_ipdltest/IPDLUnitTests.h"
michael@0 5
michael@0 6 #include "mozilla/_ipdltest/PTestMultiMgrsParent.h"
michael@0 7 #include "mozilla/_ipdltest/PTestMultiMgrsChild.h"
michael@0 8 #include "mozilla/_ipdltest/PTestMultiMgrsBottomParent.h"
michael@0 9 #include "mozilla/_ipdltest/PTestMultiMgrsBottomChild.h"
michael@0 10 #include "mozilla/_ipdltest/PTestMultiMgrsLeftParent.h"
michael@0 11 #include "mozilla/_ipdltest/PTestMultiMgrsLeftChild.h"
michael@0 12 #include "mozilla/_ipdltest/PTestMultiMgrsRightParent.h"
michael@0 13 #include "mozilla/_ipdltest/PTestMultiMgrsRightChild.h"
michael@0 14
michael@0 15 namespace mozilla {
michael@0 16 namespace _ipdltest {
michael@0 17
michael@0 18 //-----------------------------------------------------------------------------
michael@0 19 // Parent side
michael@0 20 //
michael@0 21
michael@0 22 class TestMultiMgrsBottomParent :
michael@0 23 public PTestMultiMgrsBottomParent
michael@0 24 {
michael@0 25 public:
michael@0 26 TestMultiMgrsBottomParent() { }
michael@0 27 virtual ~TestMultiMgrsBottomParent() { }
michael@0 28 };
michael@0 29
michael@0 30 class TestMultiMgrsLeftParent :
michael@0 31 public PTestMultiMgrsLeftParent
michael@0 32 {
michael@0 33 public:
michael@0 34 TestMultiMgrsLeftParent() { }
michael@0 35 virtual ~TestMultiMgrsLeftParent() { }
michael@0 36
michael@0 37 bool HasChild(TestMultiMgrsBottomParent* c)
michael@0 38 {
michael@0 39 return ManagedPTestMultiMgrsBottomParent().Contains(c);
michael@0 40 }
michael@0 41
michael@0 42 protected:
michael@0 43 virtual PTestMultiMgrsBottomParent* AllocPTestMultiMgrsBottomParent() MOZ_OVERRIDE
michael@0 44 {
michael@0 45 return new TestMultiMgrsBottomParent();
michael@0 46 }
michael@0 47
michael@0 48 virtual bool DeallocPTestMultiMgrsBottomParent(PTestMultiMgrsBottomParent* actor) MOZ_OVERRIDE
michael@0 49 {
michael@0 50 delete actor;
michael@0 51 return true;
michael@0 52 }
michael@0 53 };
michael@0 54
michael@0 55 class TestMultiMgrsRightParent :
michael@0 56 public PTestMultiMgrsRightParent
michael@0 57 {
michael@0 58 public:
michael@0 59 TestMultiMgrsRightParent() { }
michael@0 60 virtual ~TestMultiMgrsRightParent() { }
michael@0 61
michael@0 62 bool HasChild(TestMultiMgrsBottomParent* c)
michael@0 63 {
michael@0 64 return ManagedPTestMultiMgrsBottomParent().Contains(c);
michael@0 65 }
michael@0 66
michael@0 67 protected:
michael@0 68 virtual PTestMultiMgrsBottomParent* AllocPTestMultiMgrsBottomParent() MOZ_OVERRIDE
michael@0 69 {
michael@0 70 return new TestMultiMgrsBottomParent();
michael@0 71 }
michael@0 72
michael@0 73 virtual bool DeallocPTestMultiMgrsBottomParent(PTestMultiMgrsBottomParent* actor) MOZ_OVERRIDE
michael@0 74 {
michael@0 75 delete actor;
michael@0 76 return true;
michael@0 77 }
michael@0 78 };
michael@0 79
michael@0 80 class TestMultiMgrsParent :
michael@0 81 public PTestMultiMgrsParent
michael@0 82 {
michael@0 83 public:
michael@0 84 TestMultiMgrsParent() { }
michael@0 85 virtual ~TestMultiMgrsParent() { }
michael@0 86
michael@0 87 static bool RunTestInProcesses() { return true; }
michael@0 88 static bool RunTestInThreads() { return true; }
michael@0 89
michael@0 90 void Main();
michael@0 91
michael@0 92 protected:
michael@0 93 virtual bool RecvOK() MOZ_OVERRIDE;
michael@0 94
michael@0 95 virtual PTestMultiMgrsLeftParent* AllocPTestMultiMgrsLeftParent() MOZ_OVERRIDE
michael@0 96 {
michael@0 97 return new TestMultiMgrsLeftParent();
michael@0 98 }
michael@0 99
michael@0 100 virtual bool DeallocPTestMultiMgrsLeftParent(PTestMultiMgrsLeftParent* actor) MOZ_OVERRIDE
michael@0 101 {
michael@0 102 delete actor;
michael@0 103 return true;
michael@0 104 }
michael@0 105
michael@0 106 virtual PTestMultiMgrsRightParent* AllocPTestMultiMgrsRightParent() MOZ_OVERRIDE
michael@0 107 {
michael@0 108 return new TestMultiMgrsRightParent();
michael@0 109 }
michael@0 110
michael@0 111 virtual bool DeallocPTestMultiMgrsRightParent(PTestMultiMgrsRightParent* actor) MOZ_OVERRIDE
michael@0 112 {
michael@0 113 delete actor;
michael@0 114 return true;
michael@0 115 }
michael@0 116
michael@0 117 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
michael@0 118 {
michael@0 119 if (NormalShutdown != why)
michael@0 120 fail("unexpected destruction!");
michael@0 121 passed("ok");
michael@0 122 QuitParent();
michael@0 123 }
michael@0 124 };
michael@0 125
michael@0 126 //-----------------------------------------------------------------------------
michael@0 127 // Child side
michael@0 128 //
michael@0 129
michael@0 130 class TestMultiMgrsBottomChild :
michael@0 131 public PTestMultiMgrsBottomChild
michael@0 132 {
michael@0 133 public:
michael@0 134 TestMultiMgrsBottomChild() { }
michael@0 135 virtual ~TestMultiMgrsBottomChild() { }
michael@0 136 };
michael@0 137
michael@0 138 class TestMultiMgrsLeftChild :
michael@0 139 public PTestMultiMgrsLeftChild
michael@0 140 {
michael@0 141 public:
michael@0 142 TestMultiMgrsLeftChild() { }
michael@0 143 virtual ~TestMultiMgrsLeftChild() { }
michael@0 144
michael@0 145 bool HasChild(PTestMultiMgrsBottomChild* c)
michael@0 146 {
michael@0 147 return ManagedPTestMultiMgrsBottomChild().Contains(c);
michael@0 148 }
michael@0 149
michael@0 150 protected:
michael@0 151 virtual bool RecvPTestMultiMgrsBottomConstructor(PTestMultiMgrsBottomChild* actor) MOZ_OVERRIDE;
michael@0 152
michael@0 153 virtual PTestMultiMgrsBottomChild* AllocPTestMultiMgrsBottomChild() MOZ_OVERRIDE
michael@0 154 {
michael@0 155 return new TestMultiMgrsBottomChild();
michael@0 156 }
michael@0 157
michael@0 158 virtual bool DeallocPTestMultiMgrsBottomChild(PTestMultiMgrsBottomChild* actor) MOZ_OVERRIDE
michael@0 159 {
michael@0 160 delete actor;
michael@0 161 return true;
michael@0 162 }
michael@0 163 };
michael@0 164
michael@0 165 class TestMultiMgrsRightChild :
michael@0 166 public PTestMultiMgrsRightChild
michael@0 167 {
michael@0 168 public:
michael@0 169 TestMultiMgrsRightChild() { }
michael@0 170 virtual ~TestMultiMgrsRightChild() { }
michael@0 171
michael@0 172 bool HasChild(PTestMultiMgrsBottomChild* c)
michael@0 173 {
michael@0 174 return ManagedPTestMultiMgrsBottomChild().Contains(c);
michael@0 175 }
michael@0 176
michael@0 177 protected:
michael@0 178 virtual bool RecvPTestMultiMgrsBottomConstructor(PTestMultiMgrsBottomChild* actor) MOZ_OVERRIDE;
michael@0 179
michael@0 180 virtual PTestMultiMgrsBottomChild* AllocPTestMultiMgrsBottomChild() MOZ_OVERRIDE
michael@0 181 {
michael@0 182 return new TestMultiMgrsBottomChild();
michael@0 183 }
michael@0 184
michael@0 185 virtual bool DeallocPTestMultiMgrsBottomChild(PTestMultiMgrsBottomChild* actor) MOZ_OVERRIDE
michael@0 186 {
michael@0 187 delete actor;
michael@0 188 return true;
michael@0 189 }
michael@0 190 };
michael@0 191
michael@0 192 class TestMultiMgrsChild :
michael@0 193 public PTestMultiMgrsChild
michael@0 194 {
michael@0 195 public:
michael@0 196 TestMultiMgrsChild() { }
michael@0 197 virtual ~TestMultiMgrsChild() { }
michael@0 198
michael@0 199 void Main();
michael@0 200
michael@0 201 PTestMultiMgrsBottomChild* mBottomL;
michael@0 202 PTestMultiMgrsBottomChild* mBottomR;
michael@0 203
michael@0 204 protected:
michael@0 205 virtual bool RecvCheck() MOZ_OVERRIDE;
michael@0 206
michael@0 207 virtual PTestMultiMgrsLeftChild* AllocPTestMultiMgrsLeftChild() MOZ_OVERRIDE
michael@0 208 {
michael@0 209 return new TestMultiMgrsLeftChild();
michael@0 210 }
michael@0 211
michael@0 212 virtual bool DeallocPTestMultiMgrsLeftChild(PTestMultiMgrsLeftChild* actor) MOZ_OVERRIDE
michael@0 213 {
michael@0 214 delete actor;
michael@0 215 return true;
michael@0 216 }
michael@0 217
michael@0 218 virtual PTestMultiMgrsRightChild* AllocPTestMultiMgrsRightChild() MOZ_OVERRIDE
michael@0 219 {
michael@0 220 return new TestMultiMgrsRightChild();
michael@0 221 }
michael@0 222
michael@0 223 virtual bool DeallocPTestMultiMgrsRightChild(PTestMultiMgrsRightChild* actor) MOZ_OVERRIDE
michael@0 224 {
michael@0 225 delete actor;
michael@0 226 return true;
michael@0 227 }
michael@0 228
michael@0 229 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
michael@0 230 {
michael@0 231 if (NormalShutdown != why)
michael@0 232 fail("unexpected destruction!");
michael@0 233 passed("ok");
michael@0 234 QuitChild();
michael@0 235 }
michael@0 236 };
michael@0 237
michael@0 238
michael@0 239 } // namespace _ipdltest
michael@0 240 } // namespace mozilla
michael@0 241
michael@0 242
michael@0 243 #endif // ifndef mozilla__ipdltest_TestMultiMgrs_h

mercurial