diff options
author | jknotten@chromium.org <jknotten@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-03 11:01:50 +0000 |
---|---|---|
committer | jknotten@chromium.org <jknotten@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-03 11:01:50 +0000 |
commit | b7d6acc262b918a918909bd6189d218f67f3851b (patch) | |
tree | 58e2124ee0c06c3593088809844056006e94a97c /chrome/browser/extensions | |
parent | aa0f475c05efb23b5830ef583c9bf66ca6d1d562 (diff) | |
download | chromium_src-b7d6acc262b918a918909bd6189d218f67f3851b.zip chromium_src-b7d6acc262b918a918909bd6189d218f67f3851b.tar.gz chromium_src-b7d6acc262b918a918909bd6189d218f67f3851b.tar.bz2 |
Stop geolocation providers instead of joining thread.
When the last observer unsubscribes from the GeolocationProvider, send a
message to the GeolocationArbitrator to stop the providers instead of joining
the "geolocation" thread. This will avoid the UI thread being blocked for the
duration of the join.
BUG=66077
TEST=unit_test:GeolocationProviderTest.StartStop
Review URL: http://codereview.chromium.org/6340018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73611 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r-- | chrome/browser/extensions/extension_geolocation_apitest.cc | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/chrome/browser/extensions/extension_geolocation_apitest.cc b/chrome/browser/extensions/extension_geolocation_apitest.cc index dcbf763..1ce6570 100644 --- a/chrome/browser/extensions/extension_geolocation_apitest.cc +++ b/chrome/browser/extensions/extension_geolocation_apitest.cc @@ -5,15 +5,30 @@ #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/browser/geolocation/location_arbitrator.h" #include "chrome/browser/geolocation/mock_location_provider.h" +#include "chrome/browser/geolocation/arbitrator_dependency_factories_for_test.h" class GeolocationApiTest : public ExtensionApiTest { public: + GeolocationApiTest() + : dependency_factory_( + new GeolocationArbitratorDependencyFactoryWithLocationProvider( + &NewAutoSuccessMockLocationProvider)) { + } + // InProcessBrowserTest - void SetUpInProcessBrowserTestFixture() { + virtual void SetUpInProcessBrowserTestFixture() { ExtensionApiTest::SetUpInProcessBrowserTestFixture(); - GeolocationArbitrator::SetProviderFactoryForTest( - &NewAutoSuccessMockLocationProvider); + GeolocationArbitrator::SetDependencyFactoryForTest( + dependency_factory_.get()); + } + + // InProcessBrowserTest + virtual void TearDownInProcessBrowserTestFixture() { + GeolocationArbitrator::SetDependencyFactoryForTest(NULL); } + + private: + scoped_refptr<GeolocationArbitratorDependencyFactory> dependency_factory_; }; IN_PROC_BROWSER_TEST_F(GeolocationApiTest, |