Bug 1338594 - Add more basic IPDL tests. r=kanru
MozReview-Commit-ID: 2hS9GoTSyb8
new file mode 100644
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/BadNestedManagee.ipdl
@@ -0,0 +1,7 @@
+include protocol BadNestedManager;
+
+nested(upto inside_sync) async protocol BadNestedManagee {
+ manager BadNestedManager;
+child:
+ async __delete__();
+};
new file mode 100644
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/BadNestedManager.ipdl
@@ -0,0 +1,7 @@
+include protocol BadNestedManagee;
+
+nested(upto not) async protocol BadNestedManager {
+ manages BadNestedManagee;
+parent:
+ async BadNestedManagee();
+};
new file mode 100644
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/IntrAsyncManagee.ipdl
@@ -0,0 +1,7 @@
+include protocol IntrAsyncManager;
+
+intr protocol IntrAsyncManagee {
+ manager IntrAsyncManager;
+child:
+ async __delete__();
+};
new file mode 100644
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/IntrAsyncManager.ipdl
@@ -0,0 +1,7 @@
+include protocol IntrAsyncManagee;
+
+async protocol IntrAsyncManager {
+ manages IntrAsyncManagee;
+parent:
+ async IntrAsyncManagee();
+};
new file mode 100644
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/IntrSyncManagee.ipdl
@@ -0,0 +1,7 @@
+include protocol IntrSyncManager;
+
+intr protocol IntrSyncManagee {
+ manager IntrSyncManager;
+child:
+ async __delete__();
+};
new file mode 100644
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/IntrSyncManager.ipdl
@@ -0,0 +1,7 @@
+include protocol IntrSyncManagee;
+
+sync protocol IntrSyncManager {
+ manages IntrSyncManagee;
+parent:
+ async IntrSyncManagee();
+};
new file mode 100644
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/SyncAsyncManagee.ipdl
@@ -0,0 +1,7 @@
+include protocol SyncAsyncManager;
+
+sync protocol SyncAsyncManagee {
+ manager SyncAsyncManager;
+child:
+ async __delete__();
+};
new file mode 100644
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/SyncAsyncManager.ipdl
@@ -0,0 +1,7 @@
+include protocol SyncAsyncManagee;
+
+async protocol SyncAsyncManager {
+ manages SyncAsyncManagee;
+parent:
+ async SyncAsyncManagee();
+};
new file mode 100644
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/error/redeclScope.ipdlh
@@ -0,0 +1,10 @@
+struct Foo {
+ bool b;
+};
+
+struct Bar {
+ // This should produce an error saying that Foo is a redeclaration,
+ // even though the initial declaration was in a different frame of
+ // the symbol table.
+ bool Foo;
+};
new file mode 100644
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/EndpointDecl.ipdl
@@ -0,0 +1,18 @@
+
+// Basic test that Endpoint types are declared for protocols, within
+// that protocol.
+
+struct Whatever {
+ Endpoint<EndpointDeclParent> par;
+ Endpoint<EndpointDeclChild> chi;
+};
+
+namespace mozilla {
+
+protocol EndpointDecl {
+ child:
+ async Message(Endpoint<EndpointDeclParent> aEndpointParent,
+ Endpoint<EndpointDeclChild> aEndpointChild);
+};
+
+}
new file mode 100644
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/EndpointUse.ipdl
@@ -0,0 +1,9 @@
+include protocol EndpointDecl;
+
+// Basic test that Endpoint types are declared for included protocols.
+
+protocol EndpointUse {
+ child:
+ async Message(Endpoint<EndpointDeclParent> aEndpointParent,
+ Endpoint<EndpointDeclChild> aEndpointChild);
+};
new file mode 100644
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/SyncSyncManagee.ipdl
@@ -0,0 +1,7 @@
+include protocol SyncSyncManager;
+
+sync protocol SyncSyncManagee {
+ manager SyncSyncManager;
+child:
+ async __delete__();
+};
new file mode 100644
--- /dev/null
+++ b/ipc/ipdl/test/ipdl/ok/SyncSyncManager.ipdl
@@ -0,0 +1,11 @@
+include protocol SyncSyncManagee;
+
+/* The main reason for this test is that it would have caught a bug
+ * in the Rust IPDL parser that was treating "sync" like "async" in the
+ * nested case.
+ */
+nested(upto not) sync protocol SyncSyncManager {
+ manages SyncSyncManagee;
+parent:
+ async SyncSyncManagee();
+};