summaryrefslogtreecommitdiffstats
path: root/ipc/ipdl/test/ipdl
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/ipdl
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/ipdl')
-rw-r--r--ipc/ipdl/test/ipdl/IPDLCompile.py75
-rw-r--r--ipc/ipdl/test/ipdl/Makefile.in17
-rw-r--r--ipc/ipdl/test/ipdl/error/DeleteRace.ipdl14
-rw-r--r--ipc/ipdl/test/ipdl/error/Nullable.ipdl4
-rw-r--r--ipc/ipdl/test/ipdl/error/Nullable2.ipdl8
-rw-r--r--ipc/ipdl/test/ipdl/error/actorparam_badState.ipdl10
-rw-r--r--ipc/ipdl/test/ipdl/error/array_Recursive.ipdl3
-rw-r--r--ipc/ipdl/test/ipdl/error/badProtocolInclude.ipdl7
-rw-r--r--ipc/ipdl/test/ipdl/error/bridgesNonexistent.ipdl6
-rw-r--r--ipc/ipdl/test/ipdl/error/bridgesSubprotocol.ipdl13
-rw-r--r--ipc/ipdl/test/ipdl/error/compressCtor.ipdl8
-rw-r--r--ipc/ipdl/test/ipdl/error/compressCtorManagee.ipdl8
-rw-r--r--ipc/ipdl/test/ipdl/error/conflictProtocolMsg.ipdl7
-rw-r--r--ipc/ipdl/test/ipdl/error/cyclecheck_Child.ipdl12
-rw-r--r--ipc/ipdl/test/ipdl/error/cyclecheck_Grandchild.ipdl12
-rw-r--r--ipc/ipdl/test/ipdl/error/cyclecheck_Parent.ipdl10
-rw-r--r--ipc/ipdl/test/ipdl/error/dtorReserved.ipdl8
-rw-r--r--ipc/ipdl/test/ipdl/error/empty.ipdl1
-rw-r--r--ipc/ipdl/test/ipdl/error/intrMessageCompress.ipdl6
-rw-r--r--ipc/ipdl/test/ipdl/error/lex1.ipdl1
-rw-r--r--ipc/ipdl/test/ipdl/error/manageSelfToplevel.ipdl8
-rw-r--r--ipc/ipdl/test/ipdl/error/managedNoCtor.ipdl7
-rw-r--r--ipc/ipdl/test/ipdl/error/managedNoDtor.ipdl6
-rw-r--r--ipc/ipdl/test/ipdl/error/managerNoCtor.ipdl8
-rw-r--r--ipc/ipdl/test/ipdl/error/managerNoDtor.ipdl9
-rw-r--r--ipc/ipdl/test/ipdl/error/messageNoDirection.ipdl3
-rw-r--r--ipc/ipdl/test/ipdl/error/multimanDupMgrs.ipdl8
-rw-r--r--ipc/ipdl/test/ipdl/error/multimanDupMgrsMgr.ipdl9
-rw-r--r--ipc/ipdl/test/ipdl/error/multimanNonexistentMgrs.ipdl7
-rw-r--r--ipc/ipdl/test/ipdl/error/mutualRecStruct.ipdl20
-rw-r--r--ipc/ipdl/test/ipdl/error/mutualRecStructUnion.ipdl20
-rw-r--r--ipc/ipdl/test/ipdl/error/noEmptyToplevel.ipdl5
-rw-r--r--ipc/ipdl/test/ipdl/error/noProtocolInHeader.ipdlh4
-rw-r--r--ipc/ipdl/test/ipdl/error/oldIncludeSyntax.ipdl5
-rw-r--r--ipc/ipdl/test/ipdl/error/opensNonexistent.ipdl6
-rw-r--r--ipc/ipdl/test/ipdl/error/opensSubprotocol.ipdl13
-rw-r--r--ipc/ipdl/test/ipdl/error/parser.ipdl1
-rw-r--r--ipc/ipdl/test/ipdl/error/race_MultiOut.ipdl20
-rw-r--r--ipc/ipdl/test/ipdl/error/race_OverlappingMultiOut.ipdl35
-rw-r--r--ipc/ipdl/test/ipdl/error/race_ToDiffStates.ipdl20
-rw-r--r--ipc/ipdl/test/ipdl/error/race_ToError.ipdl14
-rw-r--r--ipc/ipdl/test/ipdl/error/race_ViolateSameDirection.ipdl30
-rw-r--r--ipc/ipdl/test/ipdl/error/redeclMessage.ipdl9
-rw-r--r--ipc/ipdl/test/ipdl/error/redeclParamReturn.ipdl7
-rw-r--r--ipc/ipdl/test/ipdl/error/redefState.ipdl14
-rw-r--r--ipc/ipdl/test/ipdl/error/repeatedOutState.ipdl12
-rw-r--r--ipc/ipdl/test/ipdl/error/rpcParentToChild.ipdl6
-rw-r--r--ipc/ipdl/test/ipdl/error/shmem.ipdl5
-rw-r--r--ipc/ipdl/test/ipdl/error/shmem_access_union.ipdl8
-rw-r--r--ipc/ipdl/test/ipdl/error/spawnsNonexistent.ipdl6
-rw-r--r--ipc/ipdl/test/ipdl/error/spawnsSubprotocol.ipdl13
-rw-r--r--ipc/ipdl/test/ipdl/error/structRedecl.ipdl8
-rw-r--r--ipc/ipdl/test/ipdl/error/structUnknownField.ipdl7
-rw-r--r--ipc/ipdl/test/ipdl/error/subprotocolBridges.ipdl10
-rw-r--r--ipc/ipdl/test/ipdl/error/subprotocolOpens.ipdl10
-rw-r--r--ipc/ipdl/test/ipdl/error/subprotocolSpawns.ipdl10
-rw-r--r--ipc/ipdl/test/ipdl/error/syncMessageCompress.ipdl4
-rw-r--r--ipc/ipdl/test/ipdl/error/syncParentToChild.ipdl6
-rw-r--r--ipc/ipdl/test/ipdl/error/tooWeakInterruptAsync.ipdl7
-rw-r--r--ipc/ipdl/test/ipdl/error/tooWeakRpcSync.ipdl6
-rw-r--r--ipc/ipdl/test/ipdl/error/tooWeakSyncAsync.ipdl7
-rw-r--r--ipc/ipdl/test/ipdl/error/trans_WrongDirection.ipdl12
-rw-r--r--ipc/ipdl/test/ipdl/error/trans_WrongDirection2.ipdl12
-rw-r--r--ipc/ipdl/test/ipdl/error/trans_WrongDirection3.ipdl12
-rw-r--r--ipc/ipdl/test/ipdl/error/trans_WrongDirection4.ipdl12
-rw-r--r--ipc/ipdl/test/ipdl/error/trans_WrongDirection5.ipdl12
-rw-r--r--ipc/ipdl/test/ipdl/error/trans_WrongName.ipdl10
-rw-r--r--ipc/ipdl/test/ipdl/error/trans_WrongName2.ipdl10
-rw-r--r--ipc/ipdl/test/ipdl/error/trans_WrongName3.ipdl10
-rw-r--r--ipc/ipdl/test/ipdl/error/trans_WrongName4.ipdl10
-rw-r--r--ipc/ipdl/test/ipdl/error/trans_WrongName5.ipdl10
-rw-r--r--ipc/ipdl/test/ipdl/error/twoprotocols.ipdl9
-rw-r--r--ipc/ipdl/test/ipdl/error/undeclParamType.ipdl5
-rw-r--r--ipc/ipdl/test/ipdl/error/undeclProtocol.ipdl6
-rw-r--r--ipc/ipdl/test/ipdl/error/undeclReturnType.ipdl5
-rw-r--r--ipc/ipdl/test/ipdl/error/undefMutualRecStruct.ipdl7
-rw-r--r--ipc/ipdl/test/ipdl/error/undefMutualRecStructUnion.ipdl7
-rw-r--r--ipc/ipdl/test/ipdl/error/undefMutualRecUnion.ipdl7
-rw-r--r--ipc/ipdl/test/ipdl/error/undefSelfRecStruct.ipdl5
-rw-r--r--ipc/ipdl/test/ipdl/error/undefSelfRecUnion.ipdl5
-rw-r--r--ipc/ipdl/test/ipdl/error/unreachedDelete.ipdl5
-rw-r--r--ipc/ipdl/test/ipdl/error/unreachedDeleteMultiStart.ipdl10
-rw-r--r--ipc/ipdl/test/ipdl/moz.build6
-rw-r--r--ipc/ipdl/test/ipdl/ok/Delete.ipdl8
-rw-r--r--ipc/ipdl/test/ipdl/ok/DeleteSub.ipdl12
-rw-r--r--ipc/ipdl/test/ipdl/ok/Nullable.ipdl11
-rw-r--r--ipc/ipdl/test/ipdl/ok/Struct.ipdl10
-rw-r--r--ipc/ipdl/test/ipdl/ok/actorparam.ipdl5
-rw-r--r--ipc/ipdl/test/ipdl/ok/actorparam_state.ipdl10
-rw-r--r--ipc/ipdl/test/ipdl/ok/actorreturn.ipdl6
-rw-r--r--ipc/ipdl/test/ipdl/ok/array_Basic.ipdl4
-rw-r--r--ipc/ipdl/test/ipdl/ok/array_OfActors.ipdl10
-rw-r--r--ipc/ipdl/test/ipdl/ok/array_OfActorsSub.ipdl7
-rw-r--r--ipc/ipdl/test/ipdl/ok/array_Union.ipdl10
-rw-r--r--ipc/ipdl/test/ipdl/ok/builtins.ipdl21
-rw-r--r--ipc/ipdl/test/ipdl/ok/compositor.ipdl11
-rw-r--r--ipc/ipdl/test/ipdl/ok/content.ipdl17
-rw-r--r--ipc/ipdl/test/ipdl/ok/empty.ipdl3
-rw-r--r--ipc/ipdl/test/ipdl/ok/emptyStruct.ipdl3
-rw-r--r--ipc/ipdl/test/ipdl/ok/header.ipdlh15
-rw-r--r--ipc/ipdl/test/ipdl/ok/headerProto.ipdl10
-rw-r--r--ipc/ipdl/test/ipdl/ok/intrProtocol.ipdl13
-rw-r--r--ipc/ipdl/test/ipdl/ok/jetpack.ipdl7
-rw-r--r--ipc/ipdl/test/ipdl/ok/jetpackContent.ipdl12
-rw-r--r--ipc/ipdl/test/ipdl/ok/manageSelf.ipdl10
-rw-r--r--ipc/ipdl/test/ipdl/ok/manageSelf_Toplevel.ipdl9
-rw-r--r--ipc/ipdl/test/ipdl/ok/managedProtocol.ipdl8
-rw-r--r--ipc/ipdl/test/ipdl/ok/managerProtocol.ipdl13
-rw-r--r--ipc/ipdl/test/ipdl/ok/media.ipdl7
-rw-r--r--ipc/ipdl/test/ipdl/ok/messageCompress.ipdl4
-rw-r--r--ipc/ipdl/test/ipdl/ok/messageVerify.ipdl14
-rw-r--r--ipc/ipdl/test/ipdl/ok/messageVerifyTopLevel.ipdl7
-rw-r--r--ipc/ipdl/test/ipdl/ok/multiManaged.ipdl9
-rw-r--r--ipc/ipdl/test/ipdl/ok/multiManager1.ipdl8
-rw-r--r--ipc/ipdl/test/ipdl/ok/multiManager2.ipdl8
-rw-r--r--ipc/ipdl/test/ipdl/ok/multiOutStates.ipdl12
-rw-r--r--ipc/ipdl/test/ipdl/ok/multiStartState.ipdl11
-rw-r--r--ipc/ipdl/test/ipdl/ok/multipleUsingCxxTypes.ipdl7
-rw-r--r--ipc/ipdl/test/ipdl/ok/mutualRecStructUnion.ipdl21
-rw-r--r--ipc/ipdl/test/ipdl/ok/mutualRecUnion.ipdl20
-rw-r--r--ipc/ipdl/test/ipdl/ok/namespace_Basic.ipdl12
-rw-r--r--ipc/ipdl/test/ipdl/ok/noRedeclCrossMessage.ipdl9
-rw-r--r--ipc/ipdl/test/ipdl/ok/plugin.ipdl7
-rw-r--r--ipc/ipdl/test/ipdl/ok/race_DiamondRule1.ipdl27
-rw-r--r--ipc/ipdl/test/ipdl/ok/race_KitchenSink.ipdl61
-rw-r--r--ipc/ipdl/test/ipdl/ok/race_MultiOut.ipdl35
-rw-r--r--ipc/ipdl/test/ipdl/ok/race_Stateless.ipdl16
-rw-r--r--ipc/ipdl/test/ipdl/ok/selfRecUnion.ipdl11
-rw-r--r--ipc/ipdl/test/ipdl/ok/shmem.ipdl13
-rw-r--r--ipc/ipdl/test/ipdl/ok/syncProtocol.ipdl11
-rw-r--r--ipc/ipdl/test/ipdl/ok/threeDirections.ipdl13
-rw-r--r--ipc/ipdl/test/ipdl/ok/union_Basic.ipdl11
-rw-r--r--ipc/ipdl/test/ipdl/ok/union_Namespaced.ipdl18
-rw-r--r--ipc/ipdl/test/ipdl/runtests.py75
134 files changed, 1522 insertions, 0 deletions
diff --git a/ipc/ipdl/test/ipdl/IPDLCompile.py b/ipc/ipdl/test/ipdl/IPDLCompile.py
new file mode 100644
index 000000000..e9f9d42b0
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/IPDLCompile.py
@@ -0,0 +1,75 @@
+import copy, re, os, subprocess, sys, tempfile
+
+# We test the compiler indirectly, rather than reaching into the ipdl/
+# module, to make the testing framework as general as possible.
+
+class IPDLCompile:
+ def __init__(self, specfilename, ipdlargv=[ 'python', 'ipdl.py' ]):
+ self.argv = copy.deepcopy(ipdlargv)
+ self.specfilename = specfilename
+ self.stdout = None
+ self.stderr = None
+ self.returncode = None
+
+
+ def run(self):
+ '''Run |self.specstring| through the IPDL compiler.'''
+ assert self.returncode is None
+
+ tmpoutdir = tempfile.mkdtemp(prefix='ipdl_unit_test')
+
+ try:
+ self.argv.extend([
+ '-d', tmpoutdir,
+ self.specfilename
+ ])
+
+ proc = subprocess.Popen(args=self.argv,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ self.stdout, self.stderr = proc.communicate()
+
+ self.returncode = proc.returncode
+ assert self.returncode is not None
+
+ finally:
+ for root, dirs, files in os.walk(tmpoutdir, topdown=0):
+ for name in files:
+ os.remove(os.path.join(root, name))
+ for name in dirs:
+ os.rmdir(os.path.join(root, name))
+ os.rmdir(tmpoutdir)
+
+ if proc.returncode is None:
+ proc.kill()
+
+
+ def completed(self):
+ return (self.returncode is not None
+ and isinstance(self.stdout, str)
+ and isinstance(self.stderr, str))
+
+
+ def error(self):
+ '''Return True iff compiling self.specstring resulted in an
+IPDL compiler error.'''
+ assert self.completed()
+
+ return None is not re.search(r'error:', self.stderr)
+
+
+ def exception(self):
+ '''Return True iff compiling self.specstring resulted in a Python
+exception being raised.'''
+ assert self.completed()
+
+ return None is not re.search(r'Traceback (most recent call last):',
+ self.stderr)
+
+ def ok(self):
+ '''Return True iff compiling self.specstring was successful.'''
+ assert self.completed()
+
+ return (not self.exception()
+ and not self.error()
+ and (0 == self.returncode))
diff --git a/ipc/ipdl/test/ipdl/Makefile.in b/ipc/ipdl/test/ipdl/Makefile.in
new file mode 100644
index 000000000..71981c616
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/Makefile.in
@@ -0,0 +1,17 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+include $(topsrcdir)/config/rules.mk
+
+OKTESTS := $(wildcard $(srcdir)/ok/*.ipdl) $(wildcard $(srcdir)/ok/*.ipdlh)
+ERRORTESTS := $(wildcard $(srcdir)/error/*.ipdl) $(wildcard $(srcdir)/error/*.ipdlh)
+
+check::
+ @$(PYTHON) $(srcdir)/runtests.py \
+ $(srcdir)/ok $(srcdir)/error \
+ $(PYTHON) $(topsrcdir)/config/pythonpath.py \
+ $(PLY_INCLUDE) \
+ $(topsrcdir)/ipc/ipdl/ipdl.py \
+ OKTESTS $(OKTESTS) \
+ ERRORTESTS $(ERRORTESTS)
diff --git a/ipc/ipdl/test/ipdl/error/DeleteRace.ipdl b/ipc/ipdl/test/ipdl/error/DeleteRace.ipdl
new file mode 100644
index 000000000..992bbabdf
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/DeleteRace.ipdl
@@ -0,0 +1,14 @@
+// XXX kind of a gray area whether |__delete__| should be a part of the
+// top-level protocol. but if it's ever not, this test will break and
+// we'll notice, right?
+protocol DeleteRace {
+parent:
+ async M1();
+
+child:
+ async __delete__();
+
+state START:
+ send __delete__;
+ recv M1 goto START;
+};
diff --git a/ipc/ipdl/test/ipdl/error/Nullable.ipdl b/ipc/ipdl/test/ipdl/error/Nullable.ipdl
new file mode 100644
index 000000000..cb7097f0e
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/Nullable.ipdl
@@ -0,0 +1,4 @@
+protocol Nullable {
+child:
+ async Msg(nullable int i);
+};
diff --git a/ipc/ipdl/test/ipdl/error/Nullable2.ipdl b/ipc/ipdl/test/ipdl/error/Nullable2.ipdl
new file mode 100644
index 000000000..d572951ae
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/Nullable2.ipdl
@@ -0,0 +1,8 @@
+union Union {
+ nullable int;
+};
+
+protocol Nullable2 {
+child:
+ async Msg(Union i);
+};
diff --git a/ipc/ipdl/test/ipdl/error/actorparam_badState.ipdl b/ipc/ipdl/test/ipdl/error/actorparam_badState.ipdl
new file mode 100644
index 000000000..93b8ba218
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/actorparam_badState.ipdl
@@ -0,0 +1,10 @@
+protocol actorparam_badState {
+
+child:
+ async Msg(actorparam_badState:FARGEL p);
+ async __delete__();
+
+state S1:
+ send Msg goto S1;
+ send __delete__;
+};
diff --git a/ipc/ipdl/test/ipdl/error/array_Recursive.ipdl b/ipc/ipdl/test/ipdl/error/array_Recursive.ipdl
new file mode 100644
index 000000000..898307193
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/array_Recursive.ipdl
@@ -0,0 +1,3 @@
+protocol array_Recursive {
+child: Msg(int[][] aa);
+};
diff --git a/ipc/ipdl/test/ipdl/error/badProtocolInclude.ipdl b/ipc/ipdl/test/ipdl/error/badProtocolInclude.ipdl
new file mode 100644
index 000000000..cf310f34f
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/badProtocolInclude.ipdl
@@ -0,0 +1,7 @@
+include protocol IDONTEXIST;
+
+// error: nonexistent protocol ^^^
+
+protocol badProtocolInclude {
+child: Msg();
+};
diff --git a/ipc/ipdl/test/ipdl/error/bridgesNonexistent.ipdl b/ipc/ipdl/test/ipdl/error/bridgesNonexistent.ipdl
new file mode 100644
index 000000000..313de0fd1
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/bridgesNonexistent.ipdl
@@ -0,0 +1,6 @@
+protocol bridgesNonexistent {
+ bridges Leftie, Rightie;
+
+child: __delete__();
+state DEAD: send __delete__;
+};
diff --git a/ipc/ipdl/test/ipdl/error/bridgesSubprotocol.ipdl b/ipc/ipdl/test/ipdl/error/bridgesSubprotocol.ipdl
new file mode 100644
index 000000000..a07c295d9
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/bridgesSubprotocol.ipdl
@@ -0,0 +1,13 @@
+include protocol subprotocolBridges;
+
+protocol bridgesSubprotocol {
+ bridges subprotocolBridges, subprotocolBridges;
+
+ manages subprotocolBridges;
+
+child:
+ subprotocolBridges();
+ async __delete__();
+
+state DEAD: send __delete__;
+};
diff --git a/ipc/ipdl/test/ipdl/error/compressCtor.ipdl b/ipc/ipdl/test/ipdl/error/compressCtor.ipdl
new file mode 100644
index 000000000..f1ea880b1
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/compressCtor.ipdl
@@ -0,0 +1,8 @@
+include protocol compressCtorManagee;
+
+intr protocol compressCtor {
+ manages compressCtorManagee;
+
+parent:
+ async compressCtorManagee() compress;
+};
diff --git a/ipc/ipdl/test/ipdl/error/compressCtorManagee.ipdl b/ipc/ipdl/test/ipdl/error/compressCtorManagee.ipdl
new file mode 100644
index 000000000..3d0c66c21
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/compressCtorManagee.ipdl
@@ -0,0 +1,8 @@
+include protocol compressCtor;
+
+intr protocol compressCtorManagee {
+ manager compressCtor;
+
+child:
+ async __delete__() compress;
+};
diff --git a/ipc/ipdl/test/ipdl/error/conflictProtocolMsg.ipdl b/ipc/ipdl/test/ipdl/error/conflictProtocolMsg.ipdl
new file mode 100644
index 000000000..9090c9395
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/conflictProtocolMsg.ipdl
@@ -0,0 +1,7 @@
+protocol conflictProtocolMsg {
+
+ // it's an error to re-use the protocol name as a message ID; these
+ // are reserved
+child: conflictProtocolMsg();
+
+};
diff --git a/ipc/ipdl/test/ipdl/error/cyclecheck_Child.ipdl b/ipc/ipdl/test/ipdl/error/cyclecheck_Child.ipdl
new file mode 100644
index 000000000..2e1b93299
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/cyclecheck_Child.ipdl
@@ -0,0 +1,12 @@
+include protocol cyclecheck_Parent;
+include protocol cyclecheck_Grandchild;
+
+protocol cyclecheck_Child {
+ manager cyclecheck_Parent;
+ manages cyclecheck_Grandchild;
+
+child:
+ cyclecheck_Grandchild();
+ async __delete__();
+};
+
diff --git a/ipc/ipdl/test/ipdl/error/cyclecheck_Grandchild.ipdl b/ipc/ipdl/test/ipdl/error/cyclecheck_Grandchild.ipdl
new file mode 100644
index 000000000..d91949de4
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/cyclecheck_Grandchild.ipdl
@@ -0,0 +1,12 @@
+include protocol cyclecheck_Child;
+include protocol cyclecheck_Parent;
+
+protocol cyclecheck_Grandchild {
+ manager cyclecheck_Child;
+ manages cyclecheck_Parent;
+
+child:
+ cyclecheck_Parent();
+ async __delete__();
+};
+
diff --git a/ipc/ipdl/test/ipdl/error/cyclecheck_Parent.ipdl b/ipc/ipdl/test/ipdl/error/cyclecheck_Parent.ipdl
new file mode 100644
index 000000000..666d44c54
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/cyclecheck_Parent.ipdl
@@ -0,0 +1,10 @@
+include protocol cyclecheck_Child;
+
+protocol cyclecheck_Parent {
+ manages cyclecheck_Child;
+
+child:
+ cyclecheck_Child();
+ async __delete__();
+};
+
diff --git a/ipc/ipdl/test/ipdl/error/dtorReserved.ipdl b/ipc/ipdl/test/ipdl/error/dtorReserved.ipdl
new file mode 100644
index 000000000..c59987b9c
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/dtorReserved.ipdl
@@ -0,0 +1,8 @@
+protocol dtorReserved {
+
+ // it's an error to use old-style dtor syntax
+
+child:
+ ~SomeMsg();
+
+};
diff --git a/ipc/ipdl/test/ipdl/error/empty.ipdl b/ipc/ipdl/test/ipdl/error/empty.ipdl
new file mode 100644
index 000000000..8b1378917
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/empty.ipdl
@@ -0,0 +1 @@
+
diff --git a/ipc/ipdl/test/ipdl/error/intrMessageCompress.ipdl b/ipc/ipdl/test/ipdl/error/intrMessageCompress.ipdl
new file mode 100644
index 000000000..dc0cdd800
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/intrMessageCompress.ipdl
@@ -0,0 +1,6 @@
+intr protocol intrMessageCompress {
+parent:
+ intr foo() compress;
+child:
+ intr bar() compress;
+};
diff --git a/ipc/ipdl/test/ipdl/error/lex1.ipdl b/ipc/ipdl/test/ipdl/error/lex1.ipdl
new file mode 100644
index 000000000..0ab9e1e4f
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/lex1.ipdl
@@ -0,0 +1 @@
+slkdjfl*&^*
diff --git a/ipc/ipdl/test/ipdl/error/manageSelfToplevel.ipdl b/ipc/ipdl/test/ipdl/error/manageSelfToplevel.ipdl
new file mode 100644
index 000000000..d70889126
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/manageSelfToplevel.ipdl
@@ -0,0 +1,8 @@
+protocol manageSelfToplevel {
+ manager manageSelfToplevel;
+ manages manageSelfToplevel;
+
+child:
+ manageSelfToplevel();
+ async __delete__();
+};
diff --git a/ipc/ipdl/test/ipdl/error/managedNoCtor.ipdl b/ipc/ipdl/test/ipdl/error/managedNoCtor.ipdl
new file mode 100644
index 000000000..ddc04a005
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/managedNoCtor.ipdl
@@ -0,0 +1,7 @@
+include protocol managerNoCtor;
+
+protocol managedNoCtor {
+ manager managerNoCtor;
+ // empty
+child: __delete__();
+};
diff --git a/ipc/ipdl/test/ipdl/error/managedNoDtor.ipdl b/ipc/ipdl/test/ipdl/error/managedNoDtor.ipdl
new file mode 100644
index 000000000..8d98018ee
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/managedNoDtor.ipdl
@@ -0,0 +1,6 @@
+include protocol managerNoDtor;
+
+protocol managedNoDtor {
+ manager managerNoDtor;
+ // empty
+};
diff --git a/ipc/ipdl/test/ipdl/error/managerNoCtor.ipdl b/ipc/ipdl/test/ipdl/error/managerNoCtor.ipdl
new file mode 100644
index 000000000..e39b89009
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/managerNoCtor.ipdl
@@ -0,0 +1,8 @@
+include protocol managedNoCtor;
+
+protocol managerNoCtor {
+ manages managedNoCtor;
+
+parent:
+ // error: no ctor defined
+};
diff --git a/ipc/ipdl/test/ipdl/error/managerNoDtor.ipdl b/ipc/ipdl/test/ipdl/error/managerNoDtor.ipdl
new file mode 100644
index 000000000..72e95149f
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/managerNoDtor.ipdl
@@ -0,0 +1,9 @@
+include protocol managedNoDtor;
+
+protocol managerNoDtor {
+ manages managedNoDtor;
+
+parent:
+ managedNoDtor();
+ // error: no ctor defined
+};
diff --git a/ipc/ipdl/test/ipdl/error/messageNoDirection.ipdl b/ipc/ipdl/test/ipdl/error/messageNoDirection.ipdl
new file mode 100644
index 000000000..a3d9585d4
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/messageNoDirection.ipdl
@@ -0,0 +1,3 @@
+protocol messageNoDirection {
+ async NoDirection();
+};
diff --git a/ipc/ipdl/test/ipdl/error/multimanDupMgrs.ipdl b/ipc/ipdl/test/ipdl/error/multimanDupMgrs.ipdl
new file mode 100644
index 000000000..eb89f77d8
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/multimanDupMgrs.ipdl
@@ -0,0 +1,8 @@
+include protocol multimanDupMgrsMgr;
+
+protocol multimanDupMgrs {
+ manager multimanDupMgrsMgr or multimanDupMgrsMgr;
+
+child:
+ async __delete__();
+};
diff --git a/ipc/ipdl/test/ipdl/error/multimanDupMgrsMgr.ipdl b/ipc/ipdl/test/ipdl/error/multimanDupMgrsMgr.ipdl
new file mode 100644
index 000000000..be8dfbc83
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/multimanDupMgrsMgr.ipdl
@@ -0,0 +1,9 @@
+include protocol multimanDupMgrs;
+
+protocol multimanDupMgrsMgr {
+ manages multimanDupMgrs;
+
+child:
+ multimanDupMgrs();
+ async __delete__();
+};
diff --git a/ipc/ipdl/test/ipdl/error/multimanNonexistentMgrs.ipdl b/ipc/ipdl/test/ipdl/error/multimanNonexistentMgrs.ipdl
new file mode 100644
index 000000000..dd4ba254c
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/multimanNonexistentMgrs.ipdl
@@ -0,0 +1,7 @@
+protocol multimanNonexistentManagers {
+ manager Starsky or Hutch;
+
+child:
+ async Dummy();
+ async __delete__();
+};
diff --git a/ipc/ipdl/test/ipdl/error/mutualRecStruct.ipdl b/ipc/ipdl/test/ipdl/error/mutualRecStruct.ipdl
new file mode 100644
index 000000000..fd4ee4d18
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/mutualRecStruct.ipdl
@@ -0,0 +1,20 @@
+struct X {
+ int i;
+ Y[] y;
+};
+
+struct Y {
+ X x;
+ Z z;
+};
+
+struct Z {
+ double d;
+ X x;
+};
+
+protocol mutualRecStruct {
+child:
+ async Test(X x, Y y, Z z);
+ async __delete__();
+};
diff --git a/ipc/ipdl/test/ipdl/error/mutualRecStructUnion.ipdl b/ipc/ipdl/test/ipdl/error/mutualRecStructUnion.ipdl
new file mode 100644
index 000000000..f475952d1
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/mutualRecStructUnion.ipdl
@@ -0,0 +1,20 @@
+struct X {
+ int i;
+ Y[] y;
+};
+
+union Y {
+ X;
+ Z;
+};
+
+struct Z {
+ double d;
+ X x;
+};
+
+protocol mutualRecStructUnion {
+child:
+ async Test(X x, Y y, Z z);
+ async __delete__();
+};
diff --git a/ipc/ipdl/test/ipdl/error/noEmptyToplevel.ipdl b/ipc/ipdl/test/ipdl/error/noEmptyToplevel.ipdl
new file mode 100644
index 000000000..08f13694e
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/noEmptyToplevel.ipdl
@@ -0,0 +1,5 @@
+protocol noEmptyToplevel {
+
+ // it's an error for top-level protocols to be empty
+
+};
diff --git a/ipc/ipdl/test/ipdl/error/noProtocolInHeader.ipdlh b/ipc/ipdl/test/ipdl/error/noProtocolInHeader.ipdlh
new file mode 100644
index 000000000..33571c415
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/noProtocolInHeader.ipdlh
@@ -0,0 +1,4 @@
+protocol noProtocolInHeader {
+child:
+ __delete__();
+};
diff --git a/ipc/ipdl/test/ipdl/error/oldIncludeSyntax.ipdl b/ipc/ipdl/test/ipdl/error/oldIncludeSyntax.ipdl
new file mode 100644
index 000000000..571c017c3
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/oldIncludeSyntax.ipdl
@@ -0,0 +1,5 @@
+include protocol "Foo.ipdl";
+
+protocol oldIncludeSyntax {
+
+};
diff --git a/ipc/ipdl/test/ipdl/error/opensNonexistent.ipdl b/ipc/ipdl/test/ipdl/error/opensNonexistent.ipdl
new file mode 100644
index 000000000..521f69ace
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/opensNonexistent.ipdl
@@ -0,0 +1,6 @@
+protocol opensNonexistent {
+ parent opens Unicorn;
+
+child: __delete__();
+state DEAD: send __delete__;
+};
diff --git a/ipc/ipdl/test/ipdl/error/opensSubprotocol.ipdl b/ipc/ipdl/test/ipdl/error/opensSubprotocol.ipdl
new file mode 100644
index 000000000..af884a636
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/opensSubprotocol.ipdl
@@ -0,0 +1,13 @@
+include protocol subprotocolOpens;
+
+protocol opensSubprotocol {
+ child opens subprotocolOpens;
+
+ manages subprotocolOpens;
+
+child:
+ subprotocolOpens();
+ async __delete__();
+
+state DEAD: send __delete__;
+};
diff --git a/ipc/ipdl/test/ipdl/error/parser.ipdl b/ipc/ipdl/test/ipdl/error/parser.ipdl
new file mode 100644
index 000000000..f3f273a02
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/parser.ipdl
@@ -0,0 +1 @@
+protocol parser {
diff --git a/ipc/ipdl/test/ipdl/error/race_MultiOut.ipdl b/ipc/ipdl/test/ipdl/error/race_MultiOut.ipdl
new file mode 100644
index 000000000..263d87f59
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/race_MultiOut.ipdl
@@ -0,0 +1,20 @@
+protocol race_MultiOut {
+child: M1();
+parent: M2();
+
+state S1:
+ send M1 goto S2;
+ recv M2 goto S3;
+
+state S2:
+ recv M2 goto S4 or S5;
+
+state S3:
+ send M1 goto S4 or S5;
+
+state S4:
+ send M1 goto S4;
+
+state S5:
+ recv M2 goto S5;
+};
diff --git a/ipc/ipdl/test/ipdl/error/race_OverlappingMultiOut.ipdl b/ipc/ipdl/test/ipdl/error/race_OverlappingMultiOut.ipdl
new file mode 100644
index 000000000..8aa831842
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/race_OverlappingMultiOut.ipdl
@@ -0,0 +1,35 @@
+protocol race_OverlappingMultiOut {
+child:
+ async Msg1();
+ async Msg1_();
+ async __delete__(); suppressUndeleteableError();
+
+parent:
+ async Msg2();
+ async Msg2_();
+
+
+start state _:
+ send __delete__;
+ send suppressUndeleteableError goto S10;
+
+ // *** ERROR: send/recv of Msg1/Msg2 in state S10 goes to overlapping
+ // sets { S11, S12 }, { S12, S13 } and thus can't be unidirectional
+state S10:
+ send Msg1 goto S11 or S12;
+ recv Msg2 goto S12 or S13;
+
+state S11:
+ recv Msg2 goto S14;
+
+state S12:
+ send Msg1 goto S14;
+ recv Msg2 goto S14;
+
+state S13:
+ send Msg1 goto S14;
+
+state S14:
+ send Msg1 goto S14;
+ recv Msg2 goto S14;
+};
diff --git a/ipc/ipdl/test/ipdl/error/race_ToDiffStates.ipdl b/ipc/ipdl/test/ipdl/error/race_ToDiffStates.ipdl
new file mode 100644
index 000000000..db431b146
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/race_ToDiffStates.ipdl
@@ -0,0 +1,20 @@
+protocol race_ToDiffStates {
+child: M1();
+parent: M2();
+
+state S1:
+ send M1 goto S2;
+ recv M2 goto S3;
+
+state S2:
+ recv M2 goto S4;
+
+state S3:
+ send M1 goto S5;
+
+state S4:
+ send M1 goto S4;
+
+state S5:
+ recv M2 goto S5;
+};
diff --git a/ipc/ipdl/test/ipdl/error/race_ToError.ipdl b/ipc/ipdl/test/ipdl/error/race_ToError.ipdl
new file mode 100644
index 000000000..66951fa39
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/race_ToError.ipdl
@@ -0,0 +1,14 @@
+protocol race_ToError {
+child: M1();
+parent: M2();
+
+state S1:
+ send M1 goto S2;
+ recv M2 goto S3;
+
+state S2:
+ send M1 goto S2;
+
+state S3:
+ recv M2 goto S3;
+};
diff --git a/ipc/ipdl/test/ipdl/error/race_ViolateSameDirection.ipdl b/ipc/ipdl/test/ipdl/error/race_ViolateSameDirection.ipdl
new file mode 100644
index 000000000..a1f964ec7
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/race_ViolateSameDirection.ipdl
@@ -0,0 +1,30 @@
+protocol race_ViolateSameDirection {
+child:
+ async Msg1();
+ async Msg1_();
+ async __delete__();
+ async suppressUndeleteableError();
+parent:
+ async Msg2();
+ async Msg2_();
+
+ // *** ERROR: state S7 doesn't have all-same-direction
+start state _:
+ send __delete__;
+ send suppressUndeleteableError goto S6;
+
+state S6:
+ send Msg1 goto S7;
+ recv Msg2 goto S8;
+
+state S7:
+ recv Msg2 goto S9;
+ send Msg1 goto S9;
+
+state S8:
+ send Msg1 goto S9;
+
+state S9:
+ send Msg1 goto S9;
+ recv Msg2 goto S9;
+};
diff --git a/ipc/ipdl/test/ipdl/error/redeclMessage.ipdl b/ipc/ipdl/test/ipdl/error/redeclMessage.ipdl
new file mode 100644
index 000000000..5b2cdcf70
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/redeclMessage.ipdl
@@ -0,0 +1,9 @@
+protocol redeclMessage {
+
+ // can't declare two messages with the same name
+
+child:
+ async Msg();
+ async Msg();
+
+};
diff --git a/ipc/ipdl/test/ipdl/error/redeclParamReturn.ipdl b/ipc/ipdl/test/ipdl/error/redeclParamReturn.ipdl
new file mode 100644
index 000000000..0bc2f135c
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/redeclParamReturn.ipdl
@@ -0,0 +1,7 @@
+sync protocol redeclParamReturn {
+
+ // it's an error to name a parameter with the same id as a return
+
+parent: Msg(int f) returns (bool f);
+
+};
diff --git a/ipc/ipdl/test/ipdl/error/redefState.ipdl b/ipc/ipdl/test/ipdl/error/redefState.ipdl
new file mode 100644
index 000000000..b9da7212b
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/redefState.ipdl
@@ -0,0 +1,14 @@
+protocol redefState {
+
+ // error: redefining state in state machine
+child:
+ async Msg();
+ async __delete__();
+
+state S1: send Msg goto S1;
+
+state S1: send Msg goto S1;
+
+start state _:
+ send __delete__;
+};
diff --git a/ipc/ipdl/test/ipdl/error/repeatedOutState.ipdl b/ipc/ipdl/test/ipdl/error/repeatedOutState.ipdl
new file mode 100644
index 000000000..461f7dbff
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/repeatedOutState.ipdl
@@ -0,0 +1,12 @@
+protocol repeatedOutState {
+child: Msg(); __delete__();
+
+ // error: S2 repeated in multi-out set
+
+state S1:
+ send Msg goto S2 or S2 or S4;
+
+state S2: send Msg goto S2;
+state S3: send Msg goto S3;
+state S4: send Mesg goto S4; send __delete__;
+};
diff --git a/ipc/ipdl/test/ipdl/error/rpcParentToChild.ipdl b/ipc/ipdl/test/ipdl/error/rpcParentToChild.ipdl
new file mode 100644
index 000000000..fb6cd122b
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/rpcParentToChild.ipdl
@@ -0,0 +1,6 @@
+intr protocol rpcParentToChild {
+
+ // can't declare rpc parent-to-child messages
+child: rpc Msg();
+
+};
diff --git a/ipc/ipdl/test/ipdl/error/shmem.ipdl b/ipc/ipdl/test/ipdl/error/shmem.ipdl
new file mode 100644
index 000000000..f9046fb4c
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/shmem.ipdl
@@ -0,0 +1,5 @@
+using class mozilla::ipc::Shmem from "mozilla/ipc/Shmem.h"; // redeclaration
+
+protocol shmem {
+child: Msg(Shmem s);
+};
diff --git a/ipc/ipdl/test/ipdl/error/shmem_access_union.ipdl b/ipc/ipdl/test/ipdl/error/shmem_access_union.ipdl
new file mode 100644
index 000000000..2ed162368
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/shmem_access_union.ipdl
@@ -0,0 +1,8 @@
+union Union {
+ [-r-w|+r+w] Shmem;
+};
+
+protocol shmem_access_union {
+child:
+ async Msg(Union u);
+};
diff --git a/ipc/ipdl/test/ipdl/error/spawnsNonexistent.ipdl b/ipc/ipdl/test/ipdl/error/spawnsNonexistent.ipdl
new file mode 100644
index 000000000..1bc4919bf
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/spawnsNonexistent.ipdl
@@ -0,0 +1,6 @@
+protocol spawnsNonexistent {
+ parent spawns Nonexistent;
+
+child: __delete__();
+state DEAD: send __delete__;
+};
diff --git a/ipc/ipdl/test/ipdl/error/spawnsSubprotocol.ipdl b/ipc/ipdl/test/ipdl/error/spawnsSubprotocol.ipdl
new file mode 100644
index 000000000..fc056a254
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/spawnsSubprotocol.ipdl
@@ -0,0 +1,13 @@
+include protocol subprotocolSpawns;
+
+protocol spawnsSubprotocol {
+ parent spawns subprotocolSpawns;
+
+ manages subprotocolSpawns;
+
+child:
+ subprotocolSpawns();
+ async __delete__();
+
+state DEAD: send __delete__;
+};
diff --git a/ipc/ipdl/test/ipdl/error/structRedecl.ipdl b/ipc/ipdl/test/ipdl/error/structRedecl.ipdl
new file mode 100644
index 000000000..a2e6f5c76
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/structRedecl.ipdl
@@ -0,0 +1,8 @@
+struct Redecl {
+ int a;
+ double a;
+};
+
+protocol structRedecl {
+child: __delete__();
+};
diff --git a/ipc/ipdl/test/ipdl/error/structUnknownField.ipdl b/ipc/ipdl/test/ipdl/error/structUnknownField.ipdl
new file mode 100644
index 000000000..1d5fe8896
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/structUnknownField.ipdl
@@ -0,0 +1,7 @@
+struct S {
+ Foobers i;
+};
+
+protocol structUnknownField {
+child: __delete__(S s);
+};
diff --git a/ipc/ipdl/test/ipdl/error/subprotocolBridges.ipdl b/ipc/ipdl/test/ipdl/error/subprotocolBridges.ipdl
new file mode 100644
index 000000000..68cf94547
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/subprotocolBridges.ipdl
@@ -0,0 +1,10 @@
+include protocol bridgesSubprotocol;
+
+protocol subprotocolBridges {
+ bridges bridgesSubprotocol, bridgesSubprotocol;
+
+ manager bridgesSubprotocol;
+
+child: __delete__();
+state DEAD: send __delete__;
+};
diff --git a/ipc/ipdl/test/ipdl/error/subprotocolOpens.ipdl b/ipc/ipdl/test/ipdl/error/subprotocolOpens.ipdl
new file mode 100644
index 000000000..1d6a5851d
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/subprotocolOpens.ipdl
@@ -0,0 +1,10 @@
+include protocol opensSubprotocol;
+
+protocol subprotocolOpens {
+ parent opens opensSubprotocol;
+
+ manager opensSubprotocol;
+
+child: __delete__();
+state DEAD: send __delete__;
+};
diff --git a/ipc/ipdl/test/ipdl/error/subprotocolSpawns.ipdl b/ipc/ipdl/test/ipdl/error/subprotocolSpawns.ipdl
new file mode 100644
index 000000000..e3caab624
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/subprotocolSpawns.ipdl
@@ -0,0 +1,10 @@
+include protocol spawnsSubprotocol;
+
+protocol subprotocolSpawns {
+ parent spawns spawnsSubprotocol;
+
+ manager spawnsSubprotocol;
+
+child: __delete__();
+state DEAD: send __delete__;
+};
diff --git a/ipc/ipdl/test/ipdl/error/syncMessageCompress.ipdl b/ipc/ipdl/test/ipdl/error/syncMessageCompress.ipdl
new file mode 100644
index 000000000..73c92664e
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/syncMessageCompress.ipdl
@@ -0,0 +1,4 @@
+sync protocol syncMessageCompress {
+parent:
+ sync foo() compress;
+};
diff --git a/ipc/ipdl/test/ipdl/error/syncParentToChild.ipdl b/ipc/ipdl/test/ipdl/error/syncParentToChild.ipdl
new file mode 100644
index 000000000..f0d298fe5
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/syncParentToChild.ipdl
@@ -0,0 +1,6 @@
+intr protocol syncParentToChild {
+
+ // can't declare sync parent-to-child messages
+child: sync Msg();
+
+};
diff --git a/ipc/ipdl/test/ipdl/error/tooWeakInterruptAsync.ipdl b/ipc/ipdl/test/ipdl/error/tooWeakInterruptAsync.ipdl
new file mode 100644
index 000000000..a0ee9a47c
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/tooWeakInterruptAsync.ipdl
@@ -0,0 +1,7 @@
+protocol tooWeakRPCAsync {
+
+ // it's an error to declare an async protocol with an intr message
+
+parent: intr Msg();
+
+};
diff --git a/ipc/ipdl/test/ipdl/error/tooWeakRpcSync.ipdl b/ipc/ipdl/test/ipdl/error/tooWeakRpcSync.ipdl
new file mode 100644
index 000000000..2d368de63
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/tooWeakRpcSync.ipdl
@@ -0,0 +1,6 @@
+sync protocol tooWeakRpcSync {
+
+ // it's an error to declare a sync protocol with an rpc message
+parent:
+ rpc Msg();
+};
diff --git a/ipc/ipdl/test/ipdl/error/tooWeakSyncAsync.ipdl b/ipc/ipdl/test/ipdl/error/tooWeakSyncAsync.ipdl
new file mode 100644
index 000000000..2448a0cd9
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/tooWeakSyncAsync.ipdl
@@ -0,0 +1,7 @@
+protocol tooWeakSyncAsync {
+
+ // it's an error to declare an async protocol with a sync message
+
+parent: sync Msg();
+
+};
diff --git a/ipc/ipdl/test/ipdl/error/trans_WrongDirection.ipdl b/ipc/ipdl/test/ipdl/error/trans_WrongDirection.ipdl
new file mode 100644
index 000000000..53c2fd952
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/trans_WrongDirection.ipdl
@@ -0,0 +1,12 @@
+protocol trans_WrongDirection {
+
+child:
+ async Msg();
+ async __delete__();
+
+state S1:
+ recv Msg goto S1;
+
+start state _:
+ send __delete__();
+};
diff --git a/ipc/ipdl/test/ipdl/error/trans_WrongDirection2.ipdl b/ipc/ipdl/test/ipdl/error/trans_WrongDirection2.ipdl
new file mode 100644
index 000000000..c15dfa5af
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/trans_WrongDirection2.ipdl
@@ -0,0 +1,12 @@
+protocol trans_WrongDirection2 {
+
+parent:
+ async Msg();
+ async __delete__();
+
+state S1:
+ send Msg goto S1;
+
+start state _:
+ recv __delete__;
+};
diff --git a/ipc/ipdl/test/ipdl/error/trans_WrongDirection3.ipdl b/ipc/ipdl/test/ipdl/error/trans_WrongDirection3.ipdl
new file mode 100644
index 000000000..80621ecd1
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/trans_WrongDirection3.ipdl
@@ -0,0 +1,12 @@
+sync protocol trans_WrongDirection3 {
+
+parent:
+ sync Msg();
+ async __delete__();
+
+state S1:
+ send Msg goto S1;
+
+start state _:
+ recv __delete__;
+};
diff --git a/ipc/ipdl/test/ipdl/error/trans_WrongDirection4.ipdl b/ipc/ipdl/test/ipdl/error/trans_WrongDirection4.ipdl
new file mode 100644
index 000000000..c27ad331d
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/trans_WrongDirection4.ipdl
@@ -0,0 +1,12 @@
+intr protocol trans_WrongDirection4 {
+
+child:
+ intr Msg();
+ async __delete__();
+
+state S1:
+ answer Msg goto S1;
+
+start state _:
+ send __delete__;
+};
diff --git a/ipc/ipdl/test/ipdl/error/trans_WrongDirection5.ipdl b/ipc/ipdl/test/ipdl/error/trans_WrongDirection5.ipdl
new file mode 100644
index 000000000..7997649c8
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/trans_WrongDirection5.ipdl
@@ -0,0 +1,12 @@
+intr protocol trans_WrongDirection5 {
+
+parent:
+ intr Msg();
+ async __delete__()
+
+state S1:
+ call Msg goto S1;
+
+start state_:
+ recv __delete__;
+};
diff --git a/ipc/ipdl/test/ipdl/error/trans_WrongName.ipdl b/ipc/ipdl/test/ipdl/error/trans_WrongName.ipdl
new file mode 100644
index 000000000..a944d5879
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/trans_WrongName.ipdl
@@ -0,0 +1,10 @@
+protocol trans_WrongName {
+
+child:
+ async Msg();
+ async __delete__();
+
+state S1:
+ call Msg goto S1;
+ send __delete__();
+};
diff --git a/ipc/ipdl/test/ipdl/error/trans_WrongName2.ipdl b/ipc/ipdl/test/ipdl/error/trans_WrongName2.ipdl
new file mode 100644
index 000000000..ece935b7b
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/trans_WrongName2.ipdl
@@ -0,0 +1,10 @@
+protocol trans_WrongName2 {
+
+parent:
+ async Msg();
+ async __delete__();
+
+state S1:
+ answer Msg goto S1;
+ recv __delete__;
+};
diff --git a/ipc/ipdl/test/ipdl/error/trans_WrongName3.ipdl b/ipc/ipdl/test/ipdl/error/trans_WrongName3.ipdl
new file mode 100644
index 000000000..80c54383f
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/trans_WrongName3.ipdl
@@ -0,0 +1,10 @@
+sync protocol trans_WrongName3 {
+
+parent:
+ sync Msg();
+ async __delete__();
+
+state S1:
+ answer Msg goto S1;
+ recv __delete__();
+};
diff --git a/ipc/ipdl/test/ipdl/error/trans_WrongName4.ipdl b/ipc/ipdl/test/ipdl/error/trans_WrongName4.ipdl
new file mode 100644
index 000000000..f8a9746e4
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/trans_WrongName4.ipdl
@@ -0,0 +1,10 @@
+intr protocol trans_WrongName4 {
+
+child:
+ intr Msg();
+ async __delete__();
+
+state S1:
+ send Msg goto S1;
+ send __delete__
+};
diff --git a/ipc/ipdl/test/ipdl/error/trans_WrongName5.ipdl b/ipc/ipdl/test/ipdl/error/trans_WrongName5.ipdl
new file mode 100644
index 000000000..a793905d2
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/trans_WrongName5.ipdl
@@ -0,0 +1,10 @@
+intr protocol trans_WrongName5 {
+
+parent:
+ intr Msg();
+ async __delete__();
+
+state S1:
+ recv Msg goto S1;
+ recv __delete__;
+};
diff --git a/ipc/ipdl/test/ipdl/error/twoprotocols.ipdl b/ipc/ipdl/test/ipdl/error/twoprotocols.ipdl
new file mode 100644
index 000000000..8d5cb79fc
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/twoprotocols.ipdl
@@ -0,0 +1,9 @@
+// it's an error to define two protocols in the same file
+
+protocol p1 {
+child: Msg();
+};
+
+protocol p2 {
+child: Msg();
+};
diff --git a/ipc/ipdl/test/ipdl/error/undeclParamType.ipdl b/ipc/ipdl/test/ipdl/error/undeclParamType.ipdl
new file mode 100644
index 000000000..25aa1af4f
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/undeclParamType.ipdl
@@ -0,0 +1,5 @@
+protocol undeclParamType {
+
+child: Msg(FARGLEGARGLE p);
+
+};
diff --git a/ipc/ipdl/test/ipdl/error/undeclProtocol.ipdl b/ipc/ipdl/test/ipdl/error/undeclProtocol.ipdl
new file mode 100644
index 000000000..9462e0463
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/undeclProtocol.ipdl
@@ -0,0 +1,6 @@
+protocol undeclProtocol {
+ manages undeclared;
+
+child:
+ undeclared();
+};
diff --git a/ipc/ipdl/test/ipdl/error/undeclReturnType.ipdl b/ipc/ipdl/test/ipdl/error/undeclReturnType.ipdl
new file mode 100644
index 000000000..b4bee83d1
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/undeclReturnType.ipdl
@@ -0,0 +1,5 @@
+sync protocol undeclReturnType {
+
+child: sync Msg() returns (FARGLEGARGLE r);
+
+};
diff --git a/ipc/ipdl/test/ipdl/error/undefMutualRecStruct.ipdl b/ipc/ipdl/test/ipdl/error/undefMutualRecStruct.ipdl
new file mode 100644
index 000000000..4dd89647f
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/undefMutualRecStruct.ipdl
@@ -0,0 +1,7 @@
+struct X { Y y; };
+struct Y { Z z; };
+struct Z { X x; };
+
+protocol undefMutualRecStruct {
+child: __delete__(X x);
+};
diff --git a/ipc/ipdl/test/ipdl/error/undefMutualRecStructUnion.ipdl b/ipc/ipdl/test/ipdl/error/undefMutualRecStructUnion.ipdl
new file mode 100644
index 000000000..f9177b371
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/undefMutualRecStructUnion.ipdl
@@ -0,0 +1,7 @@
+struct X { Y y; };
+union Y { Z; };
+struct Z { X x; };
+
+protocol undefMutualRecStructUnion {
+child: __delete__(X x);
+};
diff --git a/ipc/ipdl/test/ipdl/error/undefMutualRecUnion.ipdl b/ipc/ipdl/test/ipdl/error/undefMutualRecUnion.ipdl
new file mode 100644
index 000000000..be64fc040
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/undefMutualRecUnion.ipdl
@@ -0,0 +1,7 @@
+union X { Y; };
+union Y { Z; };
+union Z { X; };
+
+protocol undefMutualRecUnion {
+child: __delete__(X x);
+};
diff --git a/ipc/ipdl/test/ipdl/error/undefSelfRecStruct.ipdl b/ipc/ipdl/test/ipdl/error/undefSelfRecStruct.ipdl
new file mode 100644
index 000000000..92f47164b
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/undefSelfRecStruct.ipdl
@@ -0,0 +1,5 @@
+struct X { X x; };
+
+protocol undefSelfRecStruct {
+child: __delete__(X x);
+};
diff --git a/ipc/ipdl/test/ipdl/error/undefSelfRecUnion.ipdl b/ipc/ipdl/test/ipdl/error/undefSelfRecUnion.ipdl
new file mode 100644
index 000000000..24faf3130
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/undefSelfRecUnion.ipdl
@@ -0,0 +1,5 @@
+union X { X; };
+
+protocol undefSelfRecUnion {
+child: __delete__(X x);
+};
diff --git a/ipc/ipdl/test/ipdl/error/unreachedDelete.ipdl b/ipc/ipdl/test/ipdl/error/unreachedDelete.ipdl
new file mode 100644
index 000000000..8af41b55c
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/unreachedDelete.ipdl
@@ -0,0 +1,5 @@
+protocol unreachedDelete {
+child: M1(); __delete__();
+
+state S1: send M1 goto S1;
+};
diff --git a/ipc/ipdl/test/ipdl/error/unreachedDeleteMultiStart.ipdl b/ipc/ipdl/test/ipdl/error/unreachedDeleteMultiStart.ipdl
new file mode 100644
index 000000000..80e28a26d
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/unreachedDeleteMultiStart.ipdl
@@ -0,0 +1,10 @@
+protocol unreachedDeleteMultiStart {
+child:
+ async M1(); async M2(); async __delete__();
+
+start state S1: send M1 goto S2;
+state S2: send __delete__;
+
+start state S3: send M2 goto S4;
+state S4: send M1 goto S3;
+};
diff --git a/ipc/ipdl/test/ipdl/moz.build b/ipc/ipdl/test/ipdl/moz.build
new file mode 100644
index 000000000..28919c271
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/moz.build
@@ -0,0 +1,6 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
diff --git a/ipc/ipdl/test/ipdl/ok/Delete.ipdl b/ipc/ipdl/test/ipdl/ok/Delete.ipdl
new file mode 100644
index 000000000..311d82537
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/Delete.ipdl
@@ -0,0 +1,8 @@
+include protocol DeleteSub;
+
+sync protocol Delete {
+ manages DeleteSub;
+
+child:
+ async DeleteSub();
+};
diff --git a/ipc/ipdl/test/ipdl/ok/DeleteSub.ipdl b/ipc/ipdl/test/ipdl/ok/DeleteSub.ipdl
new file mode 100644
index 000000000..45dd2a827
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/DeleteSub.ipdl
@@ -0,0 +1,12 @@
+include protocol Delete;
+
+sync protocol DeleteSub {
+ manager Delete;
+
+parent:
+ sync __delete__(int x) returns (double d);
+
+state START:
+ recv __delete__;
+};
+
diff --git a/ipc/ipdl/test/ipdl/ok/Nullable.ipdl b/ipc/ipdl/test/ipdl/ok/Nullable.ipdl
new file mode 100644
index 000000000..6a81e125d
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/Nullable.ipdl
@@ -0,0 +1,11 @@
+union Union {
+ nullable Nullable;
+ nullable Nullable[];
+};
+
+protocol Nullable {
+child:
+ async Msg(nullable Nullable n);
+ async Msg2(nullable Nullable[] N);
+ async Msg3(Union u);
+};
diff --git a/ipc/ipdl/test/ipdl/ok/Struct.ipdl b/ipc/ipdl/test/ipdl/ok/Struct.ipdl
new file mode 100644
index 000000000..da3ca055a
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/Struct.ipdl
@@ -0,0 +1,10 @@
+struct S {
+ int i;
+ double d;
+};
+
+sync protocol Struct {
+parent:
+ sync test(S s) returns (S ss);
+ async __delete__();
+};
diff --git a/ipc/ipdl/test/ipdl/ok/actorparam.ipdl b/ipc/ipdl/test/ipdl/ok/actorparam.ipdl
new file mode 100644
index 000000000..1a3e7b972
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/actorparam.ipdl
@@ -0,0 +1,5 @@
+protocol actorparam {
+
+child: Msg(actorparam p);
+
+};
diff --git a/ipc/ipdl/test/ipdl/ok/actorparam_state.ipdl b/ipc/ipdl/test/ipdl/ok/actorparam_state.ipdl
new file mode 100644
index 000000000..5a3109f5f
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/actorparam_state.ipdl
@@ -0,0 +1,10 @@
+protocol actorparam_state {
+
+child:
+ async Msg(actorparam_state:S1 p);
+ async __delete__();
+
+state S1:
+ send Msg goto S1;
+ send __delete__;
+};
diff --git a/ipc/ipdl/test/ipdl/ok/actorreturn.ipdl b/ipc/ipdl/test/ipdl/ok/actorreturn.ipdl
new file mode 100644
index 000000000..9642ca854
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/actorreturn.ipdl
@@ -0,0 +1,6 @@
+sync protocol actorreturn {
+
+parent:
+ sync Msg(actorreturn p) returns (actorreturn r);
+
+};
diff --git a/ipc/ipdl/test/ipdl/ok/array_Basic.ipdl b/ipc/ipdl/test/ipdl/ok/array_Basic.ipdl
new file mode 100644
index 000000000..391917708
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/array_Basic.ipdl
@@ -0,0 +1,4 @@
+protocol array_Basic {
+child:
+ async Msg(int[] array);
+};
diff --git a/ipc/ipdl/test/ipdl/ok/array_OfActors.ipdl b/ipc/ipdl/test/ipdl/ok/array_OfActors.ipdl
new file mode 100644
index 000000000..8d0c7fb6a
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/array_OfActors.ipdl
@@ -0,0 +1,10 @@
+include protocol array_OfActorsSub;
+
+protocol array_OfActors {
+ manages array_OfActorsSub;
+
+child:
+ async Msg(array_OfActorsSub[] p);
+
+ array_OfActorsSub();
+};
diff --git a/ipc/ipdl/test/ipdl/ok/array_OfActorsSub.ipdl b/ipc/ipdl/test/ipdl/ok/array_OfActorsSub.ipdl
new file mode 100644
index 000000000..3b765511f
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/array_OfActorsSub.ipdl
@@ -0,0 +1,7 @@
+include protocol array_OfActors;
+
+protocol array_OfActorsSub {
+ manager array_OfActors;
+
+child: __delete__();
+};
diff --git a/ipc/ipdl/test/ipdl/ok/array_Union.ipdl b/ipc/ipdl/test/ipdl/ok/array_Union.ipdl
new file mode 100644
index 000000000..64d8adbd7
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/array_Union.ipdl
@@ -0,0 +1,10 @@
+union Union {
+ int[];
+ int;
+ double;
+};
+
+sync protocol array_Union {
+parent:
+ sync Msg(Union u, Union[] au) returns (Union r);
+};
diff --git a/ipc/ipdl/test/ipdl/ok/builtins.ipdl b/ipc/ipdl/test/ipdl/ok/builtins.ipdl
new file mode 100644
index 000000000..e407c5ed2
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/builtins.ipdl
@@ -0,0 +1,21 @@
+protocol builtins {
+
+ // sanity-check that "essential" builtins are being declared
+
+child: Msg(bool b,
+ char c,
+ int i,
+ long l,
+
+ float f,
+ double d,
+
+ int8_t i8t,
+ uint8_t u8t,
+ int16_t i16t,
+ uint16_t u16t,
+ int32_t i32t,
+ uint32_t u32t,
+ int64_t i64t,
+ uint64_t u64t);
+};
diff --git a/ipc/ipdl/test/ipdl/ok/compositor.ipdl b/ipc/ipdl/test/ipdl/ok/compositor.ipdl
new file mode 100644
index 000000000..3f1b16335
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/compositor.ipdl
@@ -0,0 +1,11 @@
+include protocol content;
+
+sync protocol compositor {
+ bridges compositor, content;
+
+child:
+ async __delete__();
+
+state DEAD:
+ send __delete__;
+};
diff --git a/ipc/ipdl/test/ipdl/ok/content.ipdl b/ipc/ipdl/test/ipdl/ok/content.ipdl
new file mode 100644
index 000000000..655998bac
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/content.ipdl
@@ -0,0 +1,17 @@
+include protocol compositor;
+include protocol jetpack;
+include protocol media;
+include protocol plugin;
+
+sync protocol content {
+ parent spawns compositor as parent;
+ parent spawns jetpack;
+ child spawns plugin;
+ child opens media;
+
+child:
+ async __delete__();
+
+state DEAD:
+ send __delete__;
+};
diff --git a/ipc/ipdl/test/ipdl/ok/empty.ipdl b/ipc/ipdl/test/ipdl/ok/empty.ipdl
new file mode 100644
index 000000000..73d512586
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/empty.ipdl
@@ -0,0 +1,3 @@
+protocol empty {
+child: Msg();
+};
diff --git a/ipc/ipdl/test/ipdl/ok/emptyStruct.ipdl b/ipc/ipdl/test/ipdl/ok/emptyStruct.ipdl
new file mode 100644
index 000000000..f6be5eb86
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/emptyStruct.ipdl
@@ -0,0 +1,3 @@
+struct empty { };
+
+protocol emptyStruct { child: __delete__(); };
diff --git a/ipc/ipdl/test/ipdl/ok/header.ipdlh b/ipc/ipdl/test/ipdl/ok/header.ipdlh
new file mode 100644
index 000000000..fc3f8c827
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/header.ipdlh
@@ -0,0 +1,15 @@
+using foo from "foo.h";
+using bar::baz from "foo.h";
+
+struct Outer { };
+
+namespace a { struct Inner1 { }; }
+
+namespace b { struct Inner2 { }; }
+
+namespace c {
+union X {
+ int32_t;
+ float;
+};
+}
diff --git a/ipc/ipdl/test/ipdl/ok/headerProto.ipdl b/ipc/ipdl/test/ipdl/ok/headerProto.ipdl
new file mode 100644
index 000000000..0bccc3834
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/headerProto.ipdl
@@ -0,0 +1,10 @@
+include header;
+
+namespace c {
+
+protocol headerProto {
+child:
+ async __delete__(foo a, baz b, Inner1 c, Inner2 d, X x);
+};
+
+}
diff --git a/ipc/ipdl/test/ipdl/ok/intrProtocol.ipdl b/ipc/ipdl/test/ipdl/ok/intrProtocol.ipdl
new file mode 100644
index 000000000..1c9327f01
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/intrProtocol.ipdl
@@ -0,0 +1,13 @@
+intr protocol intrProtocol {
+
+ // sanity check of Interrupt protocols
+child:
+ async AsyncMsg();
+
+parent:
+ sync SyncMsg(int i) returns (int r);
+
+both:
+ intr InterruptMsg(int x) returns (int y);
+
+};
diff --git a/ipc/ipdl/test/ipdl/ok/jetpack.ipdl b/ipc/ipdl/test/ipdl/ok/jetpack.ipdl
new file mode 100644
index 000000000..7cdb5c329
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/jetpack.ipdl
@@ -0,0 +1,7 @@
+sync protocol jetpack {
+child:
+ async __delete__();
+
+state DEAD:
+ send __delete__;
+};
diff --git a/ipc/ipdl/test/ipdl/ok/jetpackContent.ipdl b/ipc/ipdl/test/ipdl/ok/jetpackContent.ipdl
new file mode 100644
index 000000000..1e19c541f
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/jetpackContent.ipdl
@@ -0,0 +1,12 @@
+include protocol content;
+include protocol jetpack;
+
+intr protocol jetpackContent {
+ bridges jetpack, content;
+
+child:
+ async __delete__();
+
+state DEAD:
+ send __delete__;
+};
diff --git a/ipc/ipdl/test/ipdl/ok/manageSelf.ipdl b/ipc/ipdl/test/ipdl/ok/manageSelf.ipdl
new file mode 100644
index 000000000..b90ad7237
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/manageSelf.ipdl
@@ -0,0 +1,10 @@
+include protocol manageSelf_Toplevel;
+
+protocol manageSelf {
+ manager manageSelf_Toplevel or manageSelf;
+ manages manageSelf;
+
+child:
+ manageSelf();
+ async __delete__();
+};
diff --git a/ipc/ipdl/test/ipdl/ok/manageSelf_Toplevel.ipdl b/ipc/ipdl/test/ipdl/ok/manageSelf_Toplevel.ipdl
new file mode 100644
index 000000000..8788338f3
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/manageSelf_Toplevel.ipdl
@@ -0,0 +1,9 @@
+include protocol manageSelf;
+
+protocol manageSelf_Toplevel {
+ manages manageSelf;
+
+child:
+ manageSelf();
+ async __delete__();
+};
diff --git a/ipc/ipdl/test/ipdl/ok/managedProtocol.ipdl b/ipc/ipdl/test/ipdl/ok/managedProtocol.ipdl
new file mode 100644
index 000000000..f59ab6651
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/managedProtocol.ipdl
@@ -0,0 +1,8 @@
+include protocol managerProtocol;
+
+protocol managedProtocol {
+ manager managerProtocol;
+
+child:
+ async __delete__();
+};
diff --git a/ipc/ipdl/test/ipdl/ok/managerProtocol.ipdl b/ipc/ipdl/test/ipdl/ok/managerProtocol.ipdl
new file mode 100644
index 000000000..fc1e57ada
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/managerProtocol.ipdl
@@ -0,0 +1,13 @@
+include protocol managedProtocol;
+
+// sanity check of managed/manager protocols
+
+protocol managerProtocol {
+ manages managedProtocol;
+
+parent:
+ managedProtocol(int i);
+
+state CREATING:
+ recv managedProtocol goto CREATING;
+};
diff --git a/ipc/ipdl/test/ipdl/ok/media.ipdl b/ipc/ipdl/test/ipdl/ok/media.ipdl
new file mode 100644
index 000000000..032f7df6f
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/media.ipdl
@@ -0,0 +1,7 @@
+sync protocol media {
+child:
+ async __delete__();
+
+state DEAD:
+ send __delete__;
+};
diff --git a/ipc/ipdl/test/ipdl/ok/messageCompress.ipdl b/ipc/ipdl/test/ipdl/ok/messageCompress.ipdl
new file mode 100644
index 000000000..dd563fa3b
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/messageCompress.ipdl
@@ -0,0 +1,4 @@
+intr protocol messageCompress {
+child:
+ async foo() compress;
+};
diff --git a/ipc/ipdl/test/ipdl/ok/messageVerify.ipdl b/ipc/ipdl/test/ipdl/ok/messageVerify.ipdl
new file mode 100644
index 000000000..0de9ef4ad
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/messageVerify.ipdl
@@ -0,0 +1,14 @@
+include protocol messageVerifyTopLevel;
+
+intr protocol messageVerify {
+ manager messageVerifyTopLevel;
+
+parent:
+ sync __delete__(uint32_t x) returns (double rv1) verify;
+ async msg1() verify;
+ async msg2(uint32_t aParam1) verify;
+ sync msg3()
+ returns (uint32_t rv1) verify;
+ sync msg4(uint32_t aParam1)
+ returns (uint32_t rv1) verify;
+};
diff --git a/ipc/ipdl/test/ipdl/ok/messageVerifyTopLevel.ipdl b/ipc/ipdl/test/ipdl/ok/messageVerifyTopLevel.ipdl
new file mode 100644
index 000000000..14ff22111
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/messageVerifyTopLevel.ipdl
@@ -0,0 +1,7 @@
+include protocol messageVerify;
+
+intr protocol messageVerifyTopLevel{
+ manages messageVerify;
+ parent:
+ sync messageVerify(uint32_t aParam1) returns (double rv1) verify;
+};
diff --git a/ipc/ipdl/test/ipdl/ok/multiManaged.ipdl b/ipc/ipdl/test/ipdl/ok/multiManaged.ipdl
new file mode 100644
index 000000000..c845d5086
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/multiManaged.ipdl
@@ -0,0 +1,9 @@
+include protocol multiManager1;
+include protocol multiManager2;
+
+protocol multiManaged {
+ manager multiManager1 or multiManager2;
+
+child:
+ async __delete__();
+};
diff --git a/ipc/ipdl/test/ipdl/ok/multiManager1.ipdl b/ipc/ipdl/test/ipdl/ok/multiManager1.ipdl
new file mode 100644
index 000000000..0507a28cd
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/multiManager1.ipdl
@@ -0,0 +1,8 @@
+include protocol multiManaged;
+
+protocol multiManager1 {
+ manages multiManaged;
+
+child:
+ multiManaged();
+};
diff --git a/ipc/ipdl/test/ipdl/ok/multiManager2.ipdl b/ipc/ipdl/test/ipdl/ok/multiManager2.ipdl
new file mode 100644
index 000000000..0cad3f206
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/multiManager2.ipdl
@@ -0,0 +1,8 @@
+include protocol multiManaged;
+
+protocol multiManager2 {
+ manages multiManaged;
+
+child:
+ multiManaged();
+};
diff --git a/ipc/ipdl/test/ipdl/ok/multiOutStates.ipdl b/ipc/ipdl/test/ipdl/ok/multiOutStates.ipdl
new file mode 100644
index 000000000..d3554f9e7
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/multiOutStates.ipdl
@@ -0,0 +1,12 @@
+protocol multiOutStates {
+child: Msg();
+
+ // sanity check that multi-out-states are being processed correctly
+
+state S1:
+ send Msg goto S2 or S3 or S4;
+
+state S2: send Msg goto S2;
+state S3: send Msg goto S3;
+state S4: send Msg goto S4;
+};
diff --git a/ipc/ipdl/test/ipdl/ok/multiStartState.ipdl b/ipc/ipdl/test/ipdl/ok/multiStartState.ipdl
new file mode 100644
index 000000000..bbeb016ac
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/multiStartState.ipdl
@@ -0,0 +1,11 @@
+protocol multiStartState {
+
+child: Msg(); __delete__();
+
+start state S1:
+ send Msg goto S1; send __delete__;
+
+start state S2:
+ send Msg goto S2; send __delete__;
+
+};
diff --git a/ipc/ipdl/test/ipdl/ok/multipleUsingCxxTypes.ipdl b/ipc/ipdl/test/ipdl/ok/multipleUsingCxxTypes.ipdl
new file mode 100644
index 000000000..045d3fa6e
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/multipleUsingCxxTypes.ipdl
@@ -0,0 +1,7 @@
+using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
+using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
+
+protocol multipleUsingCxxTypes {
+child:
+ async Msg(void_t foo);
+};
diff --git a/ipc/ipdl/test/ipdl/ok/mutualRecStructUnion.ipdl b/ipc/ipdl/test/ipdl/ok/mutualRecStructUnion.ipdl
new file mode 100644
index 000000000..0891d3e78
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/mutualRecStructUnion.ipdl
@@ -0,0 +1,21 @@
+struct X {
+ int i;
+ Y[] y;
+};
+
+union Y {
+ double;
+ X;
+ Z;
+};
+
+struct Z {
+ X x;
+ Y y;
+};
+
+protocol mutualRecStructUnion {
+child:
+ async Test(X x, Y y, Z z);
+ async __delete__();
+};
diff --git a/ipc/ipdl/test/ipdl/ok/mutualRecUnion.ipdl b/ipc/ipdl/test/ipdl/ok/mutualRecUnion.ipdl
new file mode 100644
index 000000000..fcd364920
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/mutualRecUnion.ipdl
@@ -0,0 +1,20 @@
+union X {
+ int;
+ Y[];
+};
+
+union Y {
+ X;
+ Z;
+};
+
+union Z {
+ double;
+ X;
+};
+
+protocol mutualRecUnion {
+child:
+ async Test(X x, Y y, Z z);
+ async __delete__();
+};
diff --git a/ipc/ipdl/test/ipdl/ok/namespace_Basic.ipdl b/ipc/ipdl/test/ipdl/ok/namespace_Basic.ipdl
new file mode 100644
index 000000000..4eee5ffd1
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/namespace_Basic.ipdl
@@ -0,0 +1,12 @@
+namespace basic {
+
+// sanity check of namespaced protocols
+
+protocol namespace_Basic {
+
+child:
+ async Msg();
+
+};
+
+} // namespace basic
diff --git a/ipc/ipdl/test/ipdl/ok/noRedeclCrossMessage.ipdl b/ipc/ipdl/test/ipdl/ok/noRedeclCrossMessage.ipdl
new file mode 100644
index 000000000..578ac82d8
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/noRedeclCrossMessage.ipdl
@@ -0,0 +1,9 @@
+protocol noRedeclCrossMessage {
+
+ // each message has its own scope for param/return names
+
+child:
+ async Msg1(int f);
+ async Msg2(int f);
+
+};
diff --git a/ipc/ipdl/test/ipdl/ok/plugin.ipdl b/ipc/ipdl/test/ipdl/ok/plugin.ipdl
new file mode 100644
index 000000000..b1e2d24a9
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/plugin.ipdl
@@ -0,0 +1,7 @@
+intr protocol plugin {
+child:
+ async __delete__();
+
+state DEAD:
+ send __delete__;
+};
diff --git a/ipc/ipdl/test/ipdl/ok/race_DiamondRule1.ipdl b/ipc/ipdl/test/ipdl/ok/race_DiamondRule1.ipdl
new file mode 100644
index 000000000..cc1a8b16a
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/race_DiamondRule1.ipdl
@@ -0,0 +1,27 @@
+protocol race_DiamondRule1 {
+
+child:
+ async Msg1();
+ async Msg1_();
+parent:
+ async Msg2();
+ async Msg2_();
+
+ // OK: this state machine is one of the simplest that follows the
+ // Diamond Rule
+
+start state S1:
+ send Msg1 goto S2;
+ recv Msg2 goto S3;
+
+state S2:
+ recv Msg2 goto S4;
+ recv Msg2_ goto S2;
+
+state S3:
+ send Msg1 goto S4;
+ send Msg1_ goto S3;
+
+state S4:
+ send Msg1 goto S4;
+};
diff --git a/ipc/ipdl/test/ipdl/ok/race_KitchenSink.ipdl b/ipc/ipdl/test/ipdl/ok/race_KitchenSink.ipdl
new file mode 100644
index 000000000..55d674ada
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/race_KitchenSink.ipdl
@@ -0,0 +1,61 @@
+protocol race_KitchenSink {
+child:
+ async Msg1();
+ async Msg1_();
+parent:
+ async Msg2();
+ async Msg2_();
+
+
+ // concatenation of a few other state machines, should be OK
+
+start state S1:
+ send Msg1 goto S2;
+ recv Msg2 goto S3;
+
+state S2:
+ recv Msg2 goto S4;
+ recv Msg2_ goto S2;
+
+state S3:
+ send Msg1 goto S4;
+ send Msg1_ goto S3;
+
+state S4:
+ send Msg1 goto S4;
+
+
+
+start state S5:
+ send Msg1 goto S5;
+ recv Msg2 goto S5;
+
+
+
+start state S15:
+ send Msg1 goto S16 or S17;
+ recv Msg2 goto S18 or S19;
+
+state S16:
+ recv Msg2 goto S20;
+ recv Msg2_ goto S18;
+
+state S17:
+ recv Msg2 goto S20;
+ recv Msg2_ goto S15;
+
+state S18:
+ send Msg1 goto S20;
+ send Msg1_ goto S15;
+
+state S19:
+ send Msg1 goto S20;
+ send Msg1_ goto S16;
+
+state S20:
+ send Msg1 goto S20;
+ send Msg1_ goto S20;
+ recv Msg2 goto S20;
+ recv Msg2_ goto S20;
+
+};
diff --git a/ipc/ipdl/test/ipdl/ok/race_MultiOut.ipdl b/ipc/ipdl/test/ipdl/ok/race_MultiOut.ipdl
new file mode 100644
index 000000000..80cffd91c
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/race_MultiOut.ipdl
@@ -0,0 +1,35 @@
+protocol race_MultiOut {
+child:
+ async Msg1();
+ async Msg1_();
+parent:
+ async Msg2();
+ async Msg2_();
+
+start state S15:
+ send Msg1 goto S16 or S17;
+ recv Msg2 goto S18 or S19;
+
+state S16:
+ recv Msg2 goto S20;
+ recv Msg2_ goto S18;
+
+state S17:
+ recv Msg2 goto S20;
+ recv Msg2_ goto S15;
+
+state S18:
+ send Msg1 goto S20;
+ send Msg1_ goto S15;
+
+state S19:
+ send Msg1 goto S20;
+ send Msg1_ goto S16;
+
+state S20:
+ send Msg1 goto S20;
+ send Msg1_ goto S20;
+ recv Msg2 goto S20;
+ recv Msg2_ goto S20;
+
+};
diff --git a/ipc/ipdl/test/ipdl/ok/race_Stateless.ipdl b/ipc/ipdl/test/ipdl/ok/race_Stateless.ipdl
new file mode 100644
index 000000000..6cffe1e7c
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/race_Stateless.ipdl
@@ -0,0 +1,16 @@
+protocol race_Stateless {
+// manages Child;
+
+child:
+ async Msg1();
+ async Msg1_();
+parent:
+ async Msg2();
+ async Msg2_();
+
+
+ // OK: this is trivial stateless protocol, so race-free "by definition"
+start state S5:
+ send Msg1 goto S5;
+ recv Msg2 goto S5;
+};
diff --git a/ipc/ipdl/test/ipdl/ok/selfRecUnion.ipdl b/ipc/ipdl/test/ipdl/ok/selfRecUnion.ipdl
new file mode 100644
index 000000000..70f04602c
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/selfRecUnion.ipdl
@@ -0,0 +1,11 @@
+union R {
+ int;
+ double;
+ R;
+};
+
+protocol selfRecUnion {
+child:
+ async Test(R r);
+ async __delete__();
+};
diff --git a/ipc/ipdl/test/ipdl/ok/shmem.ipdl b/ipc/ipdl/test/ipdl/ok/shmem.ipdl
new file mode 100644
index 000000000..8bc44010b
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/shmem.ipdl
@@ -0,0 +1,13 @@
+union Foo {
+ int;
+ Shmem;
+};
+
+intr protocol shmem {
+parent:
+ async Msg(Shmem s, Foo f);
+ sync SyncMsg(Shmem s, Foo f)
+ returns (Shmem t, Foo g);
+ intr InterruptMsg(Shmem s, Foo f)
+ returns (Shmem t, Foo g);
+};
diff --git a/ipc/ipdl/test/ipdl/ok/syncProtocol.ipdl b/ipc/ipdl/test/ipdl/ok/syncProtocol.ipdl
new file mode 100644
index 000000000..cfe7760e6
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/syncProtocol.ipdl
@@ -0,0 +1,11 @@
+sync protocol syncProtocol {
+
+ // sanity check of sync protocols
+
+child:
+ async AsyncMsg();
+
+parent:
+ sync SyncMsg() returns (int i);
+
+};
diff --git a/ipc/ipdl/test/ipdl/ok/threeDirections.ipdl b/ipc/ipdl/test/ipdl/ok/threeDirections.ipdl
new file mode 100644
index 000000000..c06f9d56f
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/threeDirections.ipdl
@@ -0,0 +1,13 @@
+protocol threeDirections {
+
+ // sanity check that the three direction specifiers are being accepted
+child:
+ async ChildMsg();
+
+parent:
+ async ParentMsg();
+
+both:
+ async BothMsg();
+
+};
diff --git a/ipc/ipdl/test/ipdl/ok/union_Basic.ipdl b/ipc/ipdl/test/ipdl/ok/union_Basic.ipdl
new file mode 100644
index 000000000..ef5b1cbfe
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/union_Basic.ipdl
@@ -0,0 +1,11 @@
+union Basic {
+ int;
+ double;
+};
+
+sync protocol union_Basic {
+
+parent:
+ sync Msg(Basic p) returns (Basic r);
+
+};
diff --git a/ipc/ipdl/test/ipdl/ok/union_Namespaced.ipdl b/ipc/ipdl/test/ipdl/ok/union_Namespaced.ipdl
new file mode 100644
index 000000000..02f86f9de
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/union_Namespaced.ipdl
@@ -0,0 +1,18 @@
+namespace kitties {
+
+union Socks {
+ int;
+ double;
+};
+
+} // namespace kitties
+
+
+namespace puppies {
+
+protocol union_Namespaced {
+child:
+ async Msg(Socks s);
+};
+
+} // namespace puppies
diff --git a/ipc/ipdl/test/ipdl/runtests.py b/ipc/ipdl/test/ipdl/runtests.py
new file mode 100644
index 000000000..93a73729e
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/runtests.py
@@ -0,0 +1,75 @@
+import os, unittest
+
+from IPDLCompile import IPDLCompile
+
+
+class IPDLTestCase(unittest.TestCase):
+ def __init__(self, ipdlargv, filename):
+ unittest.TestCase.__init__(self, 'test')
+ self.filename = filename
+ self.compile = IPDLCompile(filename, ipdlargv)
+
+ def test(self):
+ self.compile.run()
+ self.assertFalse(self.compile.exception(), self.mkFailMsg())
+ self.checkPassed()
+
+ def mkFailMsg(self):
+ return '''
+### Command: %s
+### stderr:
+%s'''% (' '.join(self.compile.argv), self.compile.stderr)
+
+ def shortDescription(self):
+ return '%s test of "%s"'% (self.__class__.__name__, self.filename)
+
+
+class OkTestCase(IPDLTestCase):
+ '''An invocation of the IPDL compiler on a valid specification.
+The IPDL compiler should not produce errors or exceptions.'''
+
+ def __init__(self, ipdlargv, filename):
+ IPDLTestCase.__init__(self, ipdlargv, filename)
+
+ def checkPassed(self):
+ self.assertTrue(self.compile.ok(), self.mkFailMsg())
+
+
+class ErrorTestCase(IPDLTestCase):
+ '''An invocation of the IPDL compiler on an *invalid* specification.
+The IPDL compiler *should* produce errors but not exceptions.'''
+
+ def __init__(self, ipdlargv, filename):
+ IPDLTestCase.__init__(self, ipdlargv, filename)
+
+ def checkPassed(self):
+ self.assertTrue(self.compile.error(), self.mkFailMsg())
+
+
+if __name__ == '__main__':
+ import sys
+
+ okdir = sys.argv[1]
+ assert os.path.isdir(okdir)
+ errordir = sys.argv[2]
+ assert os.path.isdir(errordir)
+
+ ipdlargv = [ ]
+ oksuite = unittest.TestSuite()
+ errorsuite = unittest.TestSuite()
+
+ oktests, errortests = 0, 0
+ for arg in sys.argv[3:]:
+ if errortests:
+ errorsuite.addTest(ErrorTestCase(ipdlargv+ [ '-I', errordir ],
+ arg))
+ elif oktests:
+ if 'ERRORTESTS' == arg: errortests = 1; continue
+ oksuite.addTest(OkTestCase(ipdlargv+ [ '-I', okdir ],
+ arg))
+ else:
+ if 'OKTESTS' == arg: oktests = 1; continue
+ ipdlargv.append(arg)
+
+ (unittest.TextTestRunner()).run(
+ unittest.TestSuite([ oksuite, errorsuite ]))