See discussion in the last few comments on the bug. If we don't wait for the correct URL to load in the browser, the SpecialPowers.spawn task can get aborted, which causes the test to fail. Differential Revision: https://phabricator.services.mozilla.com/D119518