130
edits
(Added E10S section) |
(first version of the E10S section.) |
||
Line 96: | Line 96: | ||
E10S is the codename for Firefox multi-process, and what that means is that the process in which the test runs isn't the same as the one in which the test content page runs. | E10S is the codename for Firefox multi-process, and what that means is that the process in which the test runs isn't the same as the one in which the test content page runs. | ||
Learn more about E10S [https://timtaubert.de/blog/2011/08/firefox-electrolysis-101/ here], [[Electrolysis|and here]], [https://developer.mozilla.org/en-US/Firefox/Multiprocess_Firefox/The_message_manager and here]. | |||
One of the direct consequences of E10S on tests is that you cannot retrieve and manipulate objects from the content page as you'd do without E10S. | |||
Well this isn't entirely true, because of [https://developer.mozilla.org/en-US/Firefox/Multiprocess_Firefox/Cross_Process_Object_Wrappers CPOWs] (cross-process object wrappers). Using CPOWs, you somehow can access the page, get to DOM nodes, and read their attributes for instance, but a lot of other things you'd expect to work without E10S won't work exactly the same or at all, and using CPOWs is generally discouraged. | |||
So remember, when creating a new test, if this test needs to access the content page in any way, that you can use [https://developer.mozilla.org/en-US/docs/The_message_manager the message manager] to communicate to a script loaded in the content process to do things for you instead of accessing objects in the page directly. | |||
Note that a lot of tests only need to access the devtools toolbox UI anyway and don't need to interact with the content process at all. Since the toolbox lives in the same process as the test, you won't need to use the message manager to access it. | |||
== Asynchronous tests == | == Asynchronous tests == |
edits