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

Unified Diff: device/geolocation/network_location_provider_unittest.cc

Issue 2226143002: Gets rid of the LocationArbitrator interface, in preference for LocationProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'master' into lai Created 4 years, 4 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/network_location_provider.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/geolocation/network_location_provider_unittest.cc
diff --git a/device/geolocation/network_location_provider_unittest.cc b/device/geolocation/network_location_provider_unittest.cc
index c27c1dd21e98b7e94de3195a7d199f811e72f9d1..ebdbbf9445801f18f524b6ec5aa73a5a0ac43681 100644
--- a/device/geolocation/network_location_provider_unittest.cc
+++ b/device/geolocation/network_location_provider_unittest.cc
@@ -7,7 +7,9 @@
#include <stddef.h>
#include <memory>
+#include <string>
#include <utility>
+#include <vector>
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
@@ -277,9 +279,9 @@ class GeolocationNetworkProviderTest : public testing::Test {
ASSERT_TRUE(parsed_json->GetAsDictionary(&request_json));
if (!is_default_url) {
- if (expected_access_token.empty())
+ if (expected_access_token.empty()) {
ASSERT_FALSE(request_json->HasKey(kAccessTokenString));
- else {
+ } else {
std::string access_token;
EXPECT_TRUE(request_json->GetString(kAccessTokenString, &access_token));
EXPECT_EQ(expected_access_token, access_token);
@@ -381,8 +383,7 @@ TEST_F(GeolocationNetworkProviderTest, MultipleWifiScansComplete) {
fetcher->SetResponseString(kNoFixNetworkResponse);
fetcher->delegate()->OnURLFetchComplete(fetcher);
- Geoposition position;
- provider->GetPosition(&position);
+ Geoposition position = provider->GetPosition();
EXPECT_FALSE(position.Validate());
// Now wifi data arrives -- SetData will notify listeners.
@@ -411,7 +412,7 @@ TEST_F(GeolocationNetworkProviderTest, MultipleWifiScansComplete) {
fetcher->SetResponseString(kReferenceNetworkResponse);
fetcher->delegate()->OnURLFetchComplete(fetcher);
- provider->GetPosition(&position);
+ position = provider->GetPosition();
EXPECT_EQ(51.0, position.latitude);
EXPECT_EQ(-0.1, position.longitude);
EXPECT_EQ(1200.4, position.accuracy);
@@ -430,7 +431,7 @@ TEST_F(GeolocationNetworkProviderTest, MultipleWifiScansComplete) {
fetcher = get_url_fetcher_and_advance_id();
EXPECT_FALSE(fetcher);
- provider->GetPosition(&position);
+ position = provider->GetPosition();
EXPECT_EQ(51.0, position.latitude);
EXPECT_EQ(-0.1, position.longitude);
EXPECT_TRUE(position.Validate());
@@ -451,7 +452,7 @@ TEST_F(GeolocationNetworkProviderTest, MultipleWifiScansComplete) {
fetcher->delegate()->OnURLFetchComplete(fetcher);
// Error means we now no longer have a fix.
- provider->GetPosition(&position);
+ position = provider->GetPosition();
EXPECT_FALSE(position.Validate());
// Wifi scan returns to original set: should be serviced from cache.
@@ -459,7 +460,7 @@ TEST_F(GeolocationNetworkProviderTest, MultipleWifiScansComplete) {
base::RunLoop().RunUntilIdle();
EXPECT_FALSE(get_url_fetcher_and_advance_id()); // No new request created.
- provider->GetPosition(&position);
+ position = provider->GetPosition();
EXPECT_EQ(51.0, position.latitude);
EXPECT_EQ(-0.1, position.longitude);
EXPECT_TRUE(position.Validate());
« no previous file with comments | « device/geolocation/network_location_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698