| 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 ff65edff2fa87785383e926514a0dfa1d2bad537..c27c1dd21e98b7e94de3195a7d199f811e72f9d1 100644
|
| --- a/device/geolocation/network_location_provider_unittest.cc
|
| +++ b/device/geolocation/network_location_provider_unittest.cc
|
| @@ -145,7 +145,7 @@ class GeolocationNetworkProviderTest : public testing::Test {
|
| // next test step.
|
| net::TestURLFetcher* get_url_fetcher_and_advance_id() {
|
| net::TestURLFetcher* fetcher = url_fetcher_factory_.GetFetcherByID(
|
| - NetworkLocationRequest::url_fetcher_id_for_tests);
|
| + NetworkLocationRequest::url_fetcher_id_for_tests);
|
| if (fetcher)
|
| ++NetworkLocationRequest::url_fetcher_id_for_tests;
|
| return fetcher;
|
| @@ -171,7 +171,9 @@ class GeolocationNetworkProviderTest : public testing::Test {
|
| }
|
|
|
| static void CreateReferenceWifiScanDataJson(
|
| - int ap_count, int start_index, base::ListValue* wifi_access_point_list) {
|
| + int ap_count,
|
| + int start_index,
|
| + base::ListValue* wifi_access_point_list) {
|
| std::vector<std::string> wifi_data;
|
| for (int i = 0; i < ap_count; ++i) {
|
| std::unique_ptr<base::DictionaryValue> ap(new base::DictionaryValue());
|
| @@ -217,17 +219,18 @@ class GeolocationNetworkProviderTest : public testing::Test {
|
| const base::Value* expected_value;
|
| const base::Value* actual_value;
|
| if (!expected.Get(field, &expected_value))
|
| - return testing::AssertionFailure()
|
| - << "Expected dictionary " << PrettyJson(expected)
|
| - << " is missing field " << field;
|
| + return testing::AssertionFailure() << "Expected dictionary "
|
| + << PrettyJson(expected)
|
| + << " is missing field " << field;
|
| if (!expected.Get(field, &actual_value))
|
| - return testing::AssertionFailure()
|
| - << "Actual dictionary " << PrettyJson(actual)
|
| - << " is missing field " << field;
|
| + return testing::AssertionFailure() << "Actual dictionary "
|
| + << PrettyJson(actual)
|
| + << " is missing field " << field;
|
| if (!expected_value->Equals(actual_value))
|
| return testing::AssertionFailure()
|
| - << "Field " << field << " mismatch: " << PrettyJson(*expected_value)
|
| - << " != " << PrettyJson(*actual_value);
|
| + << "Field " << field
|
| + << " mismatch: " << PrettyJson(*expected_value)
|
| + << " != " << PrettyJson(*actual_value);
|
| return testing::AssertionSuccess();
|
| }
|
|
|
| @@ -256,7 +259,8 @@ class GeolocationNetworkProviderTest : public testing::Test {
|
|
|
| // Check to see that the api key is being appended for the default
|
| // network provider url.
|
| - bool is_default_url = UrlWithoutQuery(request_url) ==
|
| + bool is_default_url =
|
| + UrlWithoutQuery(request_url) ==
|
| UrlWithoutQuery(LocationArbitratorImpl::DefaultNetworkProviderURL());
|
| EXPECT_EQ(is_default_url, !request_url.query().empty());
|
|
|
| @@ -284,24 +288,22 @@ class GeolocationNetworkProviderTest : public testing::Test {
|
|
|
| if (expected_wifi_aps) {
|
| base::ListValue expected_wifi_aps_json;
|
| - CreateReferenceWifiScanDataJson(
|
| - expected_wifi_aps,
|
| - wifi_start_index,
|
| - &expected_wifi_aps_json);
|
| + CreateReferenceWifiScanDataJson(expected_wifi_aps, wifi_start_index,
|
| + &expected_wifi_aps_json);
|
| EXPECT_EQ(size_t(expected_wifi_aps), expected_wifi_aps_json.GetSize());
|
|
|
| const base::ListValue* wifi_aps_json;
|
| - ASSERT_TRUE(JsonGetList("wifiAccessPoints", *request_json,
|
| - &wifi_aps_json));
|
| - for (size_t i = 0; i < expected_wifi_aps_json.GetSize(); ++i ) {
|
| + ASSERT_TRUE(
|
| + JsonGetList("wifiAccessPoints", *request_json, &wifi_aps_json));
|
| + for (size_t i = 0; i < expected_wifi_aps_json.GetSize(); ++i) {
|
| const base::DictionaryValue* expected_json;
|
| ASSERT_TRUE(expected_wifi_aps_json.GetDictionary(i, &expected_json));
|
| const base::DictionaryValue* actual_json;
|
| ASSERT_TRUE(wifi_aps_json->GetDictionary(i, &actual_json));
|
| - ASSERT_TRUE(JsonFieldEquals("macAddress", *expected_json,
|
| - *actual_json));
|
| - ASSERT_TRUE(JsonFieldEquals("signalStrength", *expected_json,
|
| - *actual_json));
|
| + ASSERT_TRUE(
|
| + JsonFieldEquals("macAddress", *expected_json, *actual_json));
|
| + ASSERT_TRUE(
|
| + JsonFieldEquals("signalStrength", *expected_json, *actual_json));
|
| ASSERT_TRUE(JsonFieldEquals("channel", *expected_json, *actual_json));
|
| ASSERT_TRUE(JsonFieldEquals("signalToNoiseRatio", *expected_json,
|
| *actual_json));
|
| @@ -395,7 +397,8 @@ TEST_F(GeolocationNetworkProviderTest, MultipleWifiScansComplete) {
|
| // Send a reply with good position fix.
|
| const char* kReferenceNetworkResponse =
|
| "{"
|
| - " \"accessToken\": \"" REFERENCE_ACCESS_TOKEN "\","
|
| + " \"accessToken\": \"" REFERENCE_ACCESS_TOKEN
|
| + "\","
|
| " \"accuracy\": 1200.4,"
|
| " \"location\": {"
|
| " \"lat\": 51.0,"
|
| @@ -539,12 +542,12 @@ TEST_F(GeolocationNetworkProviderTest, NetworkPositionCache) {
|
| for (int i = 1; i < kCacheSize * 2 + 1; ++i) {
|
| Geoposition pos = CreateReferencePosition(i);
|
| bool ret = cache.CachePosition(CreateReferenceWifiScanData(i), pos);
|
| - EXPECT_TRUE(ret) << i;
|
| + EXPECT_TRUE(ret) << i;
|
| const Geoposition* item =
|
| cache.FindPosition(CreateReferenceWifiScanData(i));
|
| ASSERT_TRUE(item) << i;
|
| - EXPECT_EQ(pos.latitude, item->latitude) << i;
|
| - EXPECT_EQ(pos.longitude, item->longitude) << i;
|
| + EXPECT_EQ(pos.latitude, item->latitude) << i;
|
| + EXPECT_EQ(pos.longitude, item->longitude) << i;
|
| if (i <= kCacheSize) {
|
| // Nothing should have spilled yet; check oldest item is still there.
|
| EXPECT_TRUE(cache.FindPosition(CreateReferenceWifiScanData(1)));
|
|
|