fune/browser/components/newtab/test/unit/content-src/lib
Mike Conley 302950a392 Bug 1865536 - Queue and flush early messages from about:newtab after the parent-process is ready. r=Mardak
Before this patch, the about:home/about:newtab Redux store code had some
middleware that queued any messages sent from the page before the parent
had sent any messages. Presumably this was so that those messages wouldn't
be dropped if they were sent while the parent process was still setting
up its Feeds.

Unfortunately, there's a race here - if the parent process _is_ ready and
just chooses not to send any messages right away, the loaded about:home/about:newtab
document will just hold on to any actions until the parent process has
sent something down to it.

The Talos test that was failing here was waiting for the initial about:home
page to send a message which would record a Telemetry probe. That message
wasn't arriving in time. Presumably, _eventually_ the parent process would
have sent a message down to the about:home page which would flush the actions,
but the Talos test would time out before that would occur.

This patch changes things by having the _parent_ process queue any messages
sent from the content in the event that the ActivityStreamMessageChannel
is not yet set up. Once it is set up, those messages are dispatched after
the simulated NEW_TAB_INIT and NEW_TAB_LOAD for those early tabs are
sent to the parent process Redux store.

Differential Revision: https://phabricator.services.mozilla.com/D195179
2023-12-01 18:29:06 +00:00
..
detect-user-session-start.test.js
init-store.test.js
perf-service.test.js
screenshot-utils.test.js
selectLayoutRender.test.js