In order to get the test to pass I also had to employ some hacks. Some of which might not be needed. Others might point to actual bugs. - I wait for BrowserTestUtils.browserStopped instead of browserLoaded. - I added a 20ms timeout after a process switch is performed. - After waiting I use gBrowser.selectedBrowser instead of the previous browser object. Without these I would get test timeouts on `await ContentTask.spawn(... get process id )`, and even sometimes I would get the processID of the previous process, indicating that maybe the ContentTask.spawn was executed in the previous browser instead.
Bug 1527314 Comment 1 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
In order to get the test to pass I also had to employ some hacks. Some of which might not be needed. Others might point to actual bugs. - I wait for BrowserTestUtils.browserStopped instead of browserLoaded. - I added a 20ms timeout after a process switch is performed. - After waiting I use gBrowser.selectedBrowser instead of the previous browser object. Without these I would get test timeouts on `await ContentTask.spawn(... get process id )`, and even sometimes I would get the processID of the previous process, indicating that maybe the ContentTask.spawn was executed in the previous browser instead. See bug 1541389.