Extract duplicated code in browser_tests for closing a browser.
There is a lot of duplicated code, and much of it only partially duplicated (and
hence incorrect). Pull it out into the common methods
CloseBrowserSynchronously(), CloseBrowserAsynchronously() and
CloseAllBrowsers(). This fixes many Mac tests on Yosemite.
BUG=
445495
Committed:
https://crrev.com/64a6d4440f3ac8fbca44de888406da881a0f4bd1
Cr-Commit-Position: refs/heads/master@{#338340}