| Index: content/browser/geolocation/geolocation_provider_impl_unittest.cc
|
| diff --git a/device/geolocation/geolocation_provider_impl_unittest.cc b/content/browser/geolocation/geolocation_provider_impl_unittest.cc
|
| similarity index 91%
|
| rename from device/geolocation/geolocation_provider_impl_unittest.cc
|
| rename to content/browser/geolocation/geolocation_provider_impl_unittest.cc
|
| index ded7d2b0c9d3fb775c805198d9d1a5e449c759e8..62506f9688be36aeffcedc9a655eeba3b1f4caf9 100644
|
| --- a/device/geolocation/geolocation_provider_impl_unittest.cc
|
| +++ b/content/browser/geolocation/geolocation_provider_impl_unittest.cc
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "device/geolocation/geolocation_provider_impl.h"
|
| +#include "content/browser/geolocation/geolocation_provider_impl.h"
|
|
|
| #include <memory>
|
|
|
| @@ -16,8 +16,10 @@
|
| #include "base/single_thread_task_runner.h"
|
| #include "base/strings/string16.h"
|
| #include "base/time/time.h"
|
| -#include "device/geolocation/access_token_store.h"
|
| -#include "device/geolocation/mock_location_arbitrator.h"
|
| +#include "content/browser/geolocation/mock_location_arbitrator.h"
|
| +#include "content/public/browser/access_token_store.h"
|
| +#include "content/public/browser/browser_thread.h"
|
| +#include "content/public/test/test_browser_thread.h"
|
| #include "testing/gmock/include/gmock/gmock.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| @@ -26,7 +28,7 @@ using testing::Matcher;
|
| using testing::MatcherInterface;
|
| using testing::MatchResultListener;
|
|
|
| -namespace device {
|
| +namespace content {
|
|
|
| class LocationProviderForTestArbitrator : public GeolocationProviderImpl {
|
| public:
|
| @@ -120,6 +122,7 @@ class GeolocationProviderTest : public testing::Test {
|
| protected:
|
| GeolocationProviderTest()
|
| : message_loop_(),
|
| + ui_thread_(BrowserThread::UI, &message_loop_),
|
| provider_(new LocationProviderForTestArbitrator) {
|
| }
|
|
|
| @@ -135,7 +138,8 @@ class GeolocationProviderTest : public testing::Test {
|
| // Called on provider thread.
|
| void GetProvidersStarted(bool* started);
|
|
|
| - base::MessageLoopForUI message_loop_;
|
| + base::MessageLoop message_loop_;
|
| + TestBrowserThread ui_thread_;
|
| std::unique_ptr<LocationProviderForTestArbitrator> provider_;
|
| };
|
|
|
| @@ -179,7 +183,7 @@ TEST_F(GeolocationProviderTest, StartStop) {
|
| EXPECT_FALSE(provider()->IsRunning());
|
| GeolocationProviderImpl::LocationUpdateCallback callback =
|
| base::Bind(&DummyFunction);
|
| - std::unique_ptr<GeolocationProvider::Subscription> subscription =
|
| + std::unique_ptr<content::GeolocationProvider::Subscription> subscription =
|
| provider()->AddLocationUpdateCallback(callback, false);
|
| EXPECT_TRUE(provider()->IsRunning());
|
| EXPECT_TRUE(ProvidersStarted());
|
| @@ -202,7 +206,7 @@ TEST_F(GeolocationProviderTest, StalePositionNotSent) {
|
| &MockGeolocationObserver::OnLocationUpdate,
|
| base::Unretained(&first_observer));
|
| EXPECT_CALL(first_observer, OnLocationUpdate(GeopositionEq(first_position)));
|
| - std::unique_ptr<GeolocationProvider::Subscription> subscription =
|
| + std::unique_ptr<content::GeolocationProvider::Subscription> subscription =
|
| provider()->AddLocationUpdateCallback(first_callback, false);
|
| SendMockLocation(first_position);
|
| base::RunLoop().Run();
|
| @@ -223,7 +227,7 @@ TEST_F(GeolocationProviderTest, StalePositionNotSent) {
|
| GeolocationProviderImpl::LocationUpdateCallback second_callback = base::Bind(
|
| &MockGeolocationObserver::OnLocationUpdate,
|
| base::Unretained(&second_observer));
|
| - std::unique_ptr<GeolocationProvider::Subscription> subscription2 =
|
| + std::unique_ptr<content::GeolocationProvider::Subscription> subscription2 =
|
| provider()->AddLocationUpdateCallback(second_callback, false);
|
| base::RunLoop().RunUntilIdle();
|
|
|
| @@ -248,11 +252,11 @@ TEST_F(GeolocationProviderTest, OverrideLocationForTesting) {
|
| GeolocationProviderImpl::LocationUpdateCallback callback = base::Bind(
|
| &MockGeolocationObserver::OnLocationUpdate,
|
| base::Unretained(&mock_observer));
|
| - std::unique_ptr<GeolocationProvider::Subscription> subscription =
|
| + std::unique_ptr<content::GeolocationProvider::Subscription> subscription =
|
| provider()->AddLocationUpdateCallback(callback, false);
|
| subscription.reset();
|
| // Wait for the providers to be stopped now that all clients are gone.
|
| EXPECT_FALSE(ProvidersStarted());
|
| }
|
|
|
| -} // namespace device
|
| +} // namespace content
|
|
|