| Index: content/browser/geolocation/network_location_provider_unittest.cc
|
| diff --git a/content/browser/geolocation/network_location_provider_unittest.cc b/content/browser/geolocation/network_location_provider_unittest.cc
|
| index 68973fffbad331aad436092d6f056088739ba28a..56090a183a42d155d2560ae51b53cdc9a3e1e4ae 100644
|
| --- a/content/browser/geolocation/network_location_provider_unittest.cc
|
| +++ b/content/browser/geolocation/network_location_provider_unittest.cc
|
| @@ -12,6 +12,7 @@
|
| #include "base/json/json_reader.h"
|
| #include "base/json/json_writer.h"
|
| #include "base/macros.h"
|
| +#include "base/run_loop.h"
|
| #include "base/strings/string_number_conversions.h"
|
| #include "base/strings/string_util.h"
|
| #include "base/strings/stringprintf.h"
|
| @@ -352,7 +353,7 @@ TEST_F(GeolocationNetworkProviderTest, StartProviderLongRequest) {
|
| EXPECT_TRUE(provider->StartProvider(false));
|
| const int kFirstScanAps = 20;
|
| wifi_data_provider_->SetData(CreateReferenceWifiScanData(kFirstScanAps));
|
| - main_message_loop_.RunUntilIdle();
|
| + base::RunLoop().RunUntilIdle();
|
| net::TestURLFetcher* fetcher = get_url_fetcher_and_advance_id();
|
| ASSERT_TRUE(fetcher != NULL);
|
| // The request url should have been shortened to less than 2048 characters
|
| @@ -388,7 +389,7 @@ TEST_F(GeolocationNetworkProviderTest, MultipleWifiScansComplete) {
|
| // Now wifi data arrives -- SetData will notify listeners.
|
| const int kFirstScanAps = 6;
|
| wifi_data_provider_->SetData(CreateReferenceWifiScanData(kFirstScanAps));
|
| - main_message_loop_.RunUntilIdle();
|
| + base::RunLoop().RunUntilIdle();
|
| fetcher = get_url_fetcher_and_advance_id();
|
| ASSERT_TRUE(fetcher != NULL);
|
| // The request should have the wifi data.
|
| @@ -425,7 +426,7 @@ TEST_F(GeolocationNetworkProviderTest, MultipleWifiScansComplete) {
|
| // previous scan, so no new request made.
|
| const int kSecondScanAps = kFirstScanAps - 1;
|
| wifi_data_provider_->SetData(CreateReferenceWifiScanData(kSecondScanAps));
|
| - main_message_loop_.RunUntilIdle();
|
| + base::RunLoop().RunUntilIdle();
|
| fetcher = get_url_fetcher_and_advance_id();
|
| EXPECT_FALSE(fetcher);
|
|
|
| @@ -437,7 +438,7 @@ TEST_F(GeolocationNetworkProviderTest, MultipleWifiScansComplete) {
|
| // Now a third scan with more than twice the original amount -> new request.
|
| const int kThirdScanAps = kFirstScanAps * 2 + 1;
|
| wifi_data_provider_->SetData(CreateReferenceWifiScanData(kThirdScanAps));
|
| - main_message_loop_.RunUntilIdle();
|
| + base::RunLoop().RunUntilIdle();
|
| fetcher = get_url_fetcher_and_advance_id();
|
| EXPECT_TRUE(fetcher);
|
| CheckRequestIsValid(*fetcher, 0, kThirdScanAps, 0, REFERENCE_ACCESS_TOKEN);
|
| @@ -455,7 +456,7 @@ TEST_F(GeolocationNetworkProviderTest, MultipleWifiScansComplete) {
|
|
|
| // Wifi scan returns to original set: should be serviced from cache.
|
| wifi_data_provider_->SetData(CreateReferenceWifiScanData(kFirstScanAps));
|
| - main_message_loop_.RunUntilIdle();
|
| + base::RunLoop().RunUntilIdle();
|
| EXPECT_FALSE(get_url_fetcher_and_advance_id()); // No new request created.
|
|
|
| provider->GetPosition(&position);
|
| @@ -473,13 +474,13 @@ TEST_F(GeolocationNetworkProviderTest, NoRequestOnStartupUntilWifiData) {
|
| provider->SetUpdateCallback(base::Bind(
|
| &MessageLoopQuitListener::OnLocationUpdate, base::Unretained(&listener)));
|
|
|
| - main_message_loop_.RunUntilIdle();
|
| + base::RunLoop().RunUntilIdle();
|
| EXPECT_FALSE(get_url_fetcher_and_advance_id())
|
| << "Network request should not be created right away on startup when "
|
| "wifi data has not yet arrived";
|
|
|
| wifi_data_provider_->SetData(CreateReferenceWifiScanData(1));
|
| - main_message_loop_.RunUntilIdle();
|
| + base::RunLoop().RunUntilIdle();
|
| EXPECT_TRUE(get_url_fetcher_and_advance_id());
|
| }
|
|
|
| @@ -492,7 +493,7 @@ TEST_F(GeolocationNetworkProviderTest, NewDataReplacesExistingNetworkRequest) {
|
|
|
| // Now wifi data arrives; new request should be sent.
|
| wifi_data_provider_->SetData(CreateReferenceWifiScanData(4));
|
| - main_message_loop_.RunUntilIdle();
|
| + base::RunLoop().RunUntilIdle();
|
| fetcher = get_url_fetcher_and_advance_id();
|
| EXPECT_TRUE(fetcher);
|
| }
|
| @@ -521,7 +522,7 @@ TEST_F(GeolocationNetworkProviderTest,
|
|
|
| static const int kScanCount = 4;
|
| wifi_data_provider_->SetData(CreateReferenceWifiScanData(kScanCount));
|
| - main_message_loop_.RunUntilIdle();
|
| + base::RunLoop().RunUntilIdle();
|
|
|
| fetcher = get_url_fetcher_and_advance_id();
|
| EXPECT_FALSE(fetcher);
|
|
|