summaryrefslogtreecommitdiffstats
path: root/ipc/ipdl/test/cxx/TestDesc.cpp
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /ipc/ipdl/test/cxx/TestDesc.cpp
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'ipc/ipdl/test/cxx/TestDesc.cpp')
-rw-r--r--ipc/ipdl/test/cxx/TestDesc.cpp105
1 files changed, 105 insertions, 0 deletions
diff --git a/ipc/ipdl/test/cxx/TestDesc.cpp b/ipc/ipdl/test/cxx/TestDesc.cpp
new file mode 100644
index 000000000..696e5a4c5
--- /dev/null
+++ b/ipc/ipdl/test/cxx/TestDesc.cpp
@@ -0,0 +1,105 @@
+#include "TestDesc.h"
+
+#include "IPDLUnitTests.h" // fail etc.
+
+namespace mozilla {
+namespace _ipdltest {
+
+//-----------------------------------------------------------------------------
+// parent
+void
+TestDescParent::Main()
+{
+ PTestDescSubParent* p = CallPTestDescSubConstructor(0);
+ if (!p)
+ fail("can't allocate Sub");
+
+ PTestDescSubsubParent* pp = p->CallPTestDescSubsubConstructor();
+ if (!pp)
+ fail("can't allocate Subsub");
+
+ if (!SendTest(pp))
+ fail("can't send Subsub");
+}
+
+bool
+TestDescParent::RecvOk(PTestDescSubsubParent* a)
+{
+ if (!a)
+ fail("didn't receive Subsub");
+
+ if (!PTestDescSubsubParent::Call__delete__(a))
+ fail("deleting Subsub");
+
+ Close();
+
+ return true;
+}
+
+
+PTestDescSubParent*
+TestDescParent::AllocPTestDescSubParent(PTestDescSubsubParent* dummy) {
+ if (dummy)
+ fail("actor supposed to be null");
+ return new TestDescSubParent();
+}
+bool
+TestDescParent::DeallocPTestDescSubParent(PTestDescSubParent* actor)
+{
+ delete actor;
+ return true;
+}
+
+PTestDescSubsubParent*
+TestDescSubParent::AllocPTestDescSubsubParent()
+{
+ return new TestDescSubsubParent();
+}
+bool
+TestDescSubParent::DeallocPTestDescSubsubParent(PTestDescSubsubParent* actor)
+{
+ delete actor;
+ return true;
+}
+
+
+//-----------------------------------------------------------------------------
+// child
+
+bool
+TestDescChild::RecvTest(PTestDescSubsubChild* a)
+{
+ if (!a)
+ fail("didn't receive Subsub");
+ if (!SendOk(a))
+ fail("couldn't send Ok()");
+ return true;
+}
+
+PTestDescSubChild*
+TestDescChild::AllocPTestDescSubChild(PTestDescSubsubChild* dummy) {
+ if (dummy)
+ fail("actor supposed to be null");
+ return new TestDescSubChild();
+}
+bool
+TestDescChild::DeallocPTestDescSubChild(PTestDescSubChild* actor)
+{
+ delete actor;
+ return true;
+}
+
+PTestDescSubsubChild*
+TestDescSubChild::AllocPTestDescSubsubChild()
+{
+ return new TestDescSubsubChild();
+}
+bool
+TestDescSubChild::DeallocPTestDescSubsubChild(PTestDescSubsubChild* actor)
+{
+ delete actor;
+ return true;
+}
+
+} // namespace _ipdltest
+} // namespace mozilla