Layout can temporarily assign zero width causing toolbar nodes to go hidden or synthesizeClickOnSelectedTreeCell to compute invalid coordinates in the Library trees. For the toolbar, retry once if the scrollbox has zero width. Give #contentView and #placesList a minimum size of 100px. As a defensive measure, make synthesizeClickOnSelectedTreeCell wait for the target tree to have non-zero width before computing coordinates. Make some additional tests use the withLibraryWindow helper. Differential Revision: https://phabricator.services.mozilla.com/D296991