Testing IPC Internals ===================== :( --- Here's the deal. Most IPDL testing is not currently run in automation and is very rarely run "manually", for a number of reasons. As the prioritization of automated testing in Gecko continues to increase, we hope that this will change, but as of right now, there is no timeline for this. There are still a number of IPC components that are actively tested in automation and, of course, Gecko testing pretty much always involves use of IPDL actors. But that is not good enough. We will begin by detailing the tests that are run in automation and conclude by noting how users can write IPDL tests and run them locally. XPC TestShell ------------- Basic IPDL behavior is lightly tested with the XPCShell module in the `testshell `_ directory. That C++ code there is the backbone of the XPCShell `sendCommand `_ function, which uses a couple of actors to send JS commands from the main process to a content process and checks the results. At the time of this writing, there is only one nontrivial test here -- ``test_ipcshell.js``, which makes sure that it runs in the main process and ``sendCommand`` runs in a content process. It just checks that the JS function ``localeCompare`` behaves the same in both processes. .. note:: Tests that use ``sendCommand``, and hence the TestShell, exist throughout the codebase. GTests ------ Found `here `_: * ``TestLogging.cpp``: Tests the IPC logging filter function used by the environment variable ``MOZ_IPC_MESSAGE_LOG``, which lists actors to include in IPDL logging. * ``TestSharedMemory.cpp``: Tests the shared memory implementation. IPDL Tests ---------- These tests cover a large portion of the features in IPDL. They are not run in automation. They are found in two directories: * `ipdl `_: Run with ``runtests.py``. These tests ensure that the valid IPDL files in the ``ok`` directory compile successfully and the invalid files in the ``error`` directory do not. * `cxx `_: Built by normal ``mach build`` behavior when the ``mozconfig`` sets ``MOZ_IPDL_TESTS``, which it does not by default. Check the `README `_ for instructions on running and improving. .. error:: TODO: Update the ``README`` because ``make -C`` should be changed to ``mach build``, ``run-mozilla.sh`` is no longer relevant and it does not mention setting ``MOZ_IPDL_TESTS=1``.