mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-03 15:26:07 +00:00

The current implementation of addContentEventListener() is centered around the message manager. When any message manager goes away, it cleans up everything, which does not work when Fission is enabled and we do a cross-process navigation. My new implementation instead uses window actors. Message manager shared state is used to store the set of expected event listeners. New windows, after the function is called for the first time in a test, will get listeners added properly. Of windows that exist at the first time the function is called in a test, only windows associated with the BC of the browser that is passed in will get added, which is a disadvantage relative to the current setup. That could probably be fixed. We auto remove at the end of the test, not when any message manager is torn down, so there's never a need to disable auto removal. Differential Revision: https://phabricator.services.mozilla.com/D48777 --HG-- extra : moz-landing-system : lando