Shut down the ServiceWorker system as the browser's shutting down.
This avoids a DCHECK in ProfileDestroyer::DestroyProfileWhenAppropriate.
I also added a Chrome-side browsertest for the Service Worker system, where we
can check other things that only show up with this embedder.
I tried to move the DCHECK into ~BrowserContext so that we wouldn't need to
expose the Terminate() function across the Content API, but:
* BrowserContext doesn't know whether it's a "testing" profile.
* There is no BrowserContext::GetOffTheRecordProfile with which to check that
transitive processes have been shut down.
* (Minor) GetHostsForProfile() works by iterating over all hosts, and moving the
DCHECK to ~BrowserContext would have doubled the number of iterations needed.
BUG=368570
Review URL: https://codereview.chromium.org/
305723003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273741 0039d316-1c4b-4281-b951-d872f2087c98