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

Unified Diff: chromeos/network/network_configuration_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/network_configuration_handler_unittest.cc
diff --git a/chromeos/network/network_configuration_handler_unittest.cc b/chromeos/network/network_configuration_handler_unittest.cc
index 2bbe079c2bab3f142b9cf1c583d24087d3dc308a..37eb6dc8b466c3f745dd4d18dc2b3a4ecc981f44 100644
--- a/chromeos/network/network_configuration_handler_unittest.cc
+++ b/chromeos/network/network_configuration_handler_unittest.cc
@@ -12,6 +12,7 @@
#include "base/location.h"
#include "base/macros.h"
#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
#include "base/strings/string_piece.h"
@@ -206,7 +207,7 @@ class NetworkConfigurationHandlerTest : public testing::Test {
network_configuration_handler_.reset(new NetworkConfigurationHandler());
network_configuration_handler_->Init(network_state_handler_.get(),
NULL /* network_device_handler */);
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
}
void TearDown() override {
@@ -318,7 +319,7 @@ TEST_F(NetworkConfigurationHandlerTest, GetProperties) {
mock_service_client_->SetProperty(
dbus::ObjectPath(service_path), key, *networkNameValue,
base::Bind(&base::DoNothing), base::Bind(&DBusErrorCallback));
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
ShillServiceClient::DictionaryValueCallback get_properties_callback;
EXPECT_CALL(*mock_service_client_, GetProperties(_, _))
@@ -328,7 +329,7 @@ TEST_F(NetworkConfigurationHandlerTest, GetProperties) {
service_path,
base::Bind(&DictionaryValueCallback, service_path, expected_json),
base::Bind(&ErrorCallback, false, service_path));
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
}
TEST_F(NetworkConfigurationHandlerTest, SetProperties) {
@@ -348,7 +349,7 @@ TEST_F(NetworkConfigurationHandlerTest, SetProperties) {
service_path, value, NetworkConfigurationObserver::SOURCE_USER_ACTION,
base::Bind(&base::DoNothing),
base::Bind(&ErrorCallback, false, service_path));
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
}
TEST_F(NetworkConfigurationHandlerTest, ClearProperties) {
@@ -369,7 +370,7 @@ TEST_F(NetworkConfigurationHandlerTest, ClearProperties) {
service_path, value, NetworkConfigurationObserver::SOURCE_USER_ACTION,
base::Bind(&base::DoNothing),
base::Bind(&ErrorCallback, false, service_path));
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
// Now clear it.
std::vector<std::string> values_to_clear;
@@ -380,7 +381,7 @@ TEST_F(NetworkConfigurationHandlerTest, ClearProperties) {
network_configuration_handler_->ClearShillProperties(
service_path, values_to_clear, base::Bind(&base::DoNothing),
base::Bind(&ErrorCallback, false, service_path));
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
}
TEST_F(NetworkConfigurationHandlerTest, ClearPropertiesError) {
@@ -401,7 +402,7 @@ TEST_F(NetworkConfigurationHandlerTest, ClearPropertiesError) {
service_path, value, NetworkConfigurationObserver::SOURCE_USER_ACTION,
base::Bind(&base::DoNothing),
base::Bind(&ErrorCallback, false, service_path));
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
// Now clear it.
std::vector<std::string> values_to_clear;
@@ -412,7 +413,7 @@ TEST_F(NetworkConfigurationHandlerTest, ClearPropertiesError) {
network_configuration_handler_->ClearShillProperties(
service_path, values_to_clear, base::Bind(&base::DoNothing),
base::Bind(&ErrorCallback, true, service_path));
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
}
TEST_F(NetworkConfigurationHandlerTest, CreateConfiguration) {
@@ -432,7 +433,7 @@ TEST_F(NetworkConfigurationHandlerTest, CreateConfiguration) {
.WillOnce(
Invoke(this, &NetworkConfigurationHandlerTest::OnConfigureService));
CreateConfiguration("/service/2", value);
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
}
TEST_F(NetworkConfigurationHandlerTest, RemoveConfiguration) {
@@ -450,7 +451,7 @@ TEST_F(NetworkConfigurationHandlerTest, RemoveConfiguration) {
service_path, NetworkConfigurationObserver::SOURCE_USER_ACTION,
base::Bind(&TestCallback::Run, base::Unretained(&test_callback)),
base::Bind(&ErrorCallback, false, service_path));
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_EQ(1, test_callback.run_count());
EXPECT_FALSE(PendingProfileEntryDeleterForTest(service_path));
}
@@ -505,7 +506,7 @@ class NetworkConfigurationHandlerStubTest : public testing::Test {
network_configuration_handler_->Init(network_state_handler_.get(),
NULL /* network_device_handler */);
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
test_observer_->ClearPropertyUpdates();
}
@@ -551,7 +552,7 @@ class NetworkConfigurationHandlerStubTest : public testing::Test {
&NetworkConfigurationHandlerStubTest::CreateConfigurationCallback,
base::Unretained(this)),
base::Bind(&ErrorCallback, false, service_path));
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
}
protected:
@@ -606,7 +607,7 @@ TEST_F(NetworkConfigurationHandlerStubTest, StubSetAndClearProperties) {
base::Bind(&NetworkConfigurationHandlerStubTest::SuccessCallback,
base::Unretained(this), "SetProperties"),
base::Bind(&ErrorCallback, false, service_path));
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_EQ("SetProperties", success_callback_name_);
std::string identity, passphrase;
@@ -627,7 +628,7 @@ TEST_F(NetworkConfigurationHandlerStubTest, StubSetAndClearProperties) {
base::Bind(&NetworkConfigurationHandlerStubTest::SuccessCallback,
base::Unretained(this), "ClearProperties"),
base::Bind(&ErrorCallback, false, service_path));
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_EQ("ClearProperties", success_callback_name_);
EXPECT_FALSE(GetServiceStringProperty(service_path, shill::kIdentityProperty,
@@ -652,7 +653,7 @@ TEST_F(NetworkConfigurationHandlerStubTest, StubGetNameFromWifiHex) {
NetworkConfigurationObserver::SOURCE_USER_ACTION,
base::Bind(&base::DoNothing),
base::Bind(&ErrorCallback, false, service_path));
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
std::string wifi_hex_result;
EXPECT_TRUE(GetServiceStringProperty(service_path, shill::kWifiHexSsid,
&wifi_hex_result));
@@ -664,7 +665,7 @@ TEST_F(NetworkConfigurationHandlerStubTest, StubGetNameFromWifiHex) {
base::Bind(&NetworkConfigurationHandlerStubTest::GetPropertiesCallback,
base::Unretained(this)),
base::Bind(&ErrorCallback, false, service_path));
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_EQ(service_path, get_properties_path_);
std::string name_result;
@@ -713,7 +714,7 @@ TEST_F(NetworkConfigurationHandlerStubTest, NetworkConfigurationObserver) {
NetworkConfigurationObserver::SOURCE_USER_ACTION,
base::Bind(&base::DoNothing),
base::Bind(&ErrorCallback, false, service_path));
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_EQ(test_passphrase, test_observer->GetStringProperty(
service_path, shill::kPassphraseProperty));
@@ -729,7 +730,7 @@ TEST_F(NetworkConfigurationHandlerStubTest, NetworkConfigurationObserver) {
NetworkConfigurationObserver::SOURCE_USER_ACTION,
base::Bind(&base::DoNothing),
base::Bind(&ErrorCallback, false, service_path));
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_TRUE(test_observer->HasConfiguration(service_path));
EXPECT_FALSE(test_observer->HasConfigurationInProfile(
service_path, NetworkProfileHandler::GetSharedProfilePath()));
@@ -740,7 +741,7 @@ TEST_F(NetworkConfigurationHandlerStubTest, NetworkConfigurationObserver) {
service_path, NetworkConfigurationObserver::SOURCE_USER_ACTION,
base::Bind(&base::DoNothing),
base::Bind(&ErrorCallback, false, service_path));
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_FALSE(test_observer->HasConfiguration(service_path));
EXPECT_FALSE(test_observer->HasConfigurationInProfile(

Powered by Google App Engine
This is Rietveld 408576698