I think erik's point is that if windowEvents gets its events before browserEvents and if calling window.close sends the close event synchronously then you might see the following flow:

Window opens
windowEvents sees "load" - calls window.close
windowEvents sees "close" - verified that actualBrowser is empty and then ends test
browserEvents would see "load" - adds to actualBrowser
browserEvents would see "close" - adds to actualBrowser

You can avoid that by calling window.close on a setTimeout allowing the "load" to go to browserEvent if it were going to do so