Picking a switch-to-tab result switches to the target tab and closes the emptied one from UrlbarInput's pick handling; over the actor message path that runs after the synthesized keys return, so the test raced it by reading the tab count synchronously. Await the switch before asserting. Differential Revision: https://phabricator.services.mozilla.com/D310449