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

Unified Diff: chromeos/network/geolocation_handler_unittest.cc

Issue 2314853004: Remove calls to deprecated MessageLoop methods in chromeos. (Closed)
Patch Set: Created 4 years, 3 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
Index: chromeos/network/geolocation_handler_unittest.cc
diff --git a/chromeos/network/geolocation_handler_unittest.cc b/chromeos/network/geolocation_handler_unittest.cc
index 7cf1fc9cf3053805703173589fda087e2d48e613..49a98464e0395faa8acd6eba2f412537d6f2e152 100644
--- a/chromeos/network/geolocation_handler_unittest.cc
+++ b/chromeos/network/geolocation_handler_unittest.cc
@@ -8,6 +8,7 @@
#include "base/macros.h"
#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
@@ -34,7 +35,7 @@ class GeolocationHandlerTest : public testing::Test {
ASSERT_TRUE(manager_test_);
geolocation_handler_.reset(new GeolocationHandler());
geolocation_handler_->Init();
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
}
void TearDown() override {
@@ -61,7 +62,7 @@ class GeolocationHandlerTest : public testing::Test {
properties.SetStringWithoutPathExpansion(
shill::kGeoSignalStrengthProperty, strength);
manager_test_->AddGeoNetwork(shill::kTypeWifi, properties);
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
}
protected:
@@ -77,7 +78,7 @@ class GeolocationHandlerTest : public testing::Test {
TEST_F(GeolocationHandlerTest, NoAccessPoints) {
// Inititial call should return false.
EXPECT_FALSE(GetWifiAccessPoints());
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
// Second call should return false since there are no devices.
EXPECT_FALSE(GetWifiAccessPoints());
}
@@ -85,10 +86,10 @@ TEST_F(GeolocationHandlerTest, NoAccessPoints) {
TEST_F(GeolocationHandlerTest, OneAccessPoint) {
// Add an acces point.
AddAccessPoint(1);
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
// Inititial call should return false and request access points.
EXPECT_FALSE(GetWifiAccessPoints());
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
// Second call should return true since we have an access point.
EXPECT_TRUE(GetWifiAccessPoints());
ASSERT_EQ(1u, wifi_access_points_.size());
@@ -101,10 +102,10 @@ TEST_F(GeolocationHandlerTest, MultipleAccessPoints) {
AddAccessPoint(1);
AddAccessPoint(2);
AddAccessPoint(3);
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
// Inititial call should return false and request access points.
EXPECT_FALSE(GetWifiAccessPoints());
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
// Second call should return true since we have an access point.
EXPECT_TRUE(GetWifiAccessPoints());
ASSERT_EQ(3u, wifi_access_points_.size());

Powered by Google App Engine
This is Rietveld 408576698