Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1023)

Unified Diff: device/geolocation/geolocation_provider_impl_unittest.cc

Issue 2192683002: Reland 2:Geolocation: move from content/browser to device/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ignore size_t_to_int truncation warning Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/geolocation/geolocation_provider_impl.cc ('k') | device/geolocation/geolocation_service_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/geolocation/geolocation_provider_impl_unittest.cc
diff --git a/content/browser/geolocation/geolocation_provider_impl_unittest.cc b/device/geolocation/geolocation_provider_impl_unittest.cc
similarity index 91%
rename from content/browser/geolocation/geolocation_provider_impl_unittest.cc
rename to device/geolocation/geolocation_provider_impl_unittest.cc
index 62506f9688be36aeffcedc9a655eeba3b1f4caf9..ded7d2b0c9d3fb775c805198d9d1a5e449c759e8 100644
--- a/content/browser/geolocation/geolocation_provider_impl_unittest.cc
+++ b/device/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 "content/browser/geolocation/geolocation_provider_impl.h"
+#include "device/geolocation/geolocation_provider_impl.h"
#include <memory>
@@ -16,10 +16,8 @@
#include "base/single_thread_task_runner.h"
#include "base/strings/string16.h"
#include "base/time/time.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 "device/geolocation/access_token_store.h"
+#include "device/geolocation/mock_location_arbitrator.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -28,7 +26,7 @@ using testing::Matcher;
using testing::MatcherInterface;
using testing::MatchResultListener;
-namespace content {
+namespace device {
class LocationProviderForTestArbitrator : public GeolocationProviderImpl {
public:
@@ -122,7 +120,6 @@ class GeolocationProviderTest : public testing::Test {
protected:
GeolocationProviderTest()
: message_loop_(),
- ui_thread_(BrowserThread::UI, &message_loop_),
provider_(new LocationProviderForTestArbitrator) {
}
@@ -138,8 +135,7 @@ class GeolocationProviderTest : public testing::Test {
// Called on provider thread.
void GetProvidersStarted(bool* started);
- base::MessageLoop message_loop_;
- TestBrowserThread ui_thread_;
+ base::MessageLoopForUI message_loop_;
std::unique_ptr<LocationProviderForTestArbitrator> provider_;
};
@@ -183,7 +179,7 @@ TEST_F(GeolocationProviderTest, StartStop) {
EXPECT_FALSE(provider()->IsRunning());
GeolocationProviderImpl::LocationUpdateCallback callback =
base::Bind(&DummyFunction);
- std::unique_ptr<content::GeolocationProvider::Subscription> subscription =
+ std::unique_ptr<GeolocationProvider::Subscription> subscription =
provider()->AddLocationUpdateCallback(callback, false);
EXPECT_TRUE(provider()->IsRunning());
EXPECT_TRUE(ProvidersStarted());
@@ -206,7 +202,7 @@ TEST_F(GeolocationProviderTest, StalePositionNotSent) {
&MockGeolocationObserver::OnLocationUpdate,
base::Unretained(&first_observer));
EXPECT_CALL(first_observer, OnLocationUpdate(GeopositionEq(first_position)));
- std::unique_ptr<content::GeolocationProvider::Subscription> subscription =
+ std::unique_ptr<GeolocationProvider::Subscription> subscription =
provider()->AddLocationUpdateCallback(first_callback, false);
SendMockLocation(first_position);
base::RunLoop().Run();
@@ -227,7 +223,7 @@ TEST_F(GeolocationProviderTest, StalePositionNotSent) {
GeolocationProviderImpl::LocationUpdateCallback second_callback = base::Bind(
&MockGeolocationObserver::OnLocationUpdate,
base::Unretained(&second_observer));
- std::unique_ptr<content::GeolocationProvider::Subscription> subscription2 =
+ std::unique_ptr<GeolocationProvider::Subscription> subscription2 =
provider()->AddLocationUpdateCallback(second_callback, false);
base::RunLoop().RunUntilIdle();
@@ -252,11 +248,11 @@ TEST_F(GeolocationProviderTest, OverrideLocationForTesting) {
GeolocationProviderImpl::LocationUpdateCallback callback = base::Bind(
&MockGeolocationObserver::OnLocationUpdate,
base::Unretained(&mock_observer));
- std::unique_ptr<content::GeolocationProvider::Subscription> subscription =
+ std::unique_ptr<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 content
+} // namespace device
« no previous file with comments | « device/geolocation/geolocation_provider_impl.cc ('k') | device/geolocation/geolocation_service_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698