diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-06 16:56:19 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-06 16:56:19 +0000 |
commit | 7ff48ca7c36e03a70d42838b57d7576fd6866fd3 (patch) | |
tree | a4094090054ef5954b381625c6116b5cf9ad49d1 /base/system_monitor | |
parent | 3eb2899b90415acb389db29933f1bfe249f6355d (diff) | |
download | chromium_src-7ff48ca7c36e03a70d42838b57d7576fd6866fd3.zip chromium_src-7ff48ca7c36e03a70d42838b57d7576fd6866fd3.tar.gz chromium_src-7ff48ca7c36e03a70d42838b57d7576fd6866fd3.tar.bz2 |
base: Convert the remaining uses of MessageLoop::RunUntilIdle to RunLoop variant.
The former method is deprecated and actually it is just using RunLoop internally.
The later is the cannonical method and should be used instead.
BUG=131220
TEST=base_unittests
R=darin@chromium.org
Review URL: https://chromiumcodereview.appspot.com/12226007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180991 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/system_monitor')
-rw-r--r-- | base/system_monitor/system_monitor_unittest.cc | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/base/system_monitor/system_monitor_unittest.cc b/base/system_monitor/system_monitor_unittest.cc index 10bd7e7..56f48ef 100644 --- a/base/system_monitor/system_monitor_unittest.cc +++ b/base/system_monitor/system_monitor_unittest.cc @@ -6,6 +6,7 @@ #include "base/file_path.h" #include "base/message_loop.h" +#include "base/run_loop.h" #include "base/test/mock_devices_changed_observer.h" #include "base/utf_string_conversions.h" #include "testing/gmock/include/gmock/gmock.h" @@ -80,27 +81,27 @@ TEST_F(SystemMonitorTest, PowerNotifications) { // Sending resume when not suspended should have no effect. system_monitor_->ProcessPowerMessage(SystemMonitor::RESUME_EVENT); - message_loop_.RunUntilIdle(); + RunLoop().RunUntilIdle(); EXPECT_EQ(test[0].resumes(), 0); // Pretend we suspended. system_monitor_->ProcessPowerMessage(SystemMonitor::SUSPEND_EVENT); - message_loop_.RunUntilIdle(); + RunLoop().RunUntilIdle(); EXPECT_EQ(test[0].suspends(), 1); // Send a second suspend notification. This should be suppressed. system_monitor_->ProcessPowerMessage(SystemMonitor::SUSPEND_EVENT); - message_loop_.RunUntilIdle(); + RunLoop().RunUntilIdle(); EXPECT_EQ(test[0].suspends(), 1); // Pretend we were awakened. system_monitor_->ProcessPowerMessage(SystemMonitor::RESUME_EVENT); - message_loop_.RunUntilIdle(); + RunLoop().RunUntilIdle(); EXPECT_EQ(test[0].resumes(), 1); // Send a duplicate resume notification. This should be suppressed. system_monitor_->ProcessPowerMessage(SystemMonitor::RESUME_EVENT); - message_loop_.RunUntilIdle(); + RunLoop().RunUntilIdle(); EXPECT_EQ(test[0].resumes(), 1); } @@ -130,20 +131,20 @@ TEST_F(SystemMonitorTest, DeviceChangeNotifications) { } system_monitor_->ProcessDevicesChanged(SystemMonitor::DEVTYPE_UNKNOWN); - message_loop_.RunUntilIdle(); + RunLoop().RunUntilIdle(); system_monitor_->ProcessDevicesChanged(SystemMonitor::DEVTYPE_UNKNOWN); system_monitor_->ProcessDevicesChanged(SystemMonitor::DEVTYPE_UNKNOWN); - message_loop_.RunUntilIdle(); + RunLoop().RunUntilIdle(); system_monitor_->ProcessRemovableStorageAttached(kDeviceId1, kDeviceName, FILE_PATH_LITERAL("path")); - message_loop_.RunUntilIdle(); + RunLoop().RunUntilIdle(); system_monitor_->ProcessRemovableStorageDetached(kDeviceId1); system_monitor_->ProcessRemovableStorageDetached(kDeviceId2); - message_loop_.RunUntilIdle(); + RunLoop().RunUntilIdle(); } TEST_F(SystemMonitorTest, GetAttachedRemovableStorageEmpty) { @@ -159,7 +160,7 @@ TEST_F(SystemMonitorTest, GetAttachedRemovableStorageAttachDetach) { system_monitor_->ProcessRemovableStorageAttached(kDeviceId1, kDeviceName1, kDevicePath1.value()); - message_loop_.RunUntilIdle(); + RunLoop().RunUntilIdle(); std::vector<SystemMonitor::RemovableStorageInfo> devices = system_monitor_->GetAttachedRemovableStorage(); ASSERT_EQ(1U, devices.size()); @@ -173,7 +174,7 @@ TEST_F(SystemMonitorTest, GetAttachedRemovableStorageAttachDetach) { system_monitor_->ProcessRemovableStorageAttached(kDeviceId2, kDeviceName2, kDevicePath2.value()); - message_loop_.RunUntilIdle(); + RunLoop().RunUntilIdle(); devices = system_monitor_->GetAttachedRemovableStorage(); ASSERT_EQ(2U, devices.size()); EXPECT_EQ(kDeviceId1, devices[0].device_id); @@ -184,7 +185,7 @@ TEST_F(SystemMonitorTest, GetAttachedRemovableStorageAttachDetach) { EXPECT_EQ(kDevicePath2.value(), devices[1].location); system_monitor_->ProcessRemovableStorageDetached(kDeviceId1); - message_loop_.RunUntilIdle(); + RunLoop().RunUntilIdle(); devices = system_monitor_->GetAttachedRemovableStorage(); ASSERT_EQ(1U, devices.size()); EXPECT_EQ(kDeviceId2, devices[0].device_id); @@ -192,7 +193,7 @@ TEST_F(SystemMonitorTest, GetAttachedRemovableStorageAttachDetach) { EXPECT_EQ(kDevicePath2.value(), devices[0].location); system_monitor_->ProcessRemovableStorageDetached(kDeviceId2); - message_loop_.RunUntilIdle(); + RunLoop().RunUntilIdle(); devices = system_monitor_->GetAttachedRemovableStorage(); EXPECT_EQ(0U, devices.size()); } |