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

Unified Diff: base/system_monitor/system_monitor_unittest.cc

Issue 12226007: base: Convert the remaining uses of MessageLoop::RunUntilIdle to RunLoop variant. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win Created 7 years, 10 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
« no previous file with comments | « base/prefs/json_pref_store_unittest.cc ('k') | base/task_runner_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/system_monitor/system_monitor_unittest.cc
diff --git a/base/system_monitor/system_monitor_unittest.cc b/base/system_monitor/system_monitor_unittest.cc
index 10bd7e7acad0be85f7ce8bb5c5da932136680dbe..56f48ef8320608afc50e16f5d47ca7647e1fe17d 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());
}
« no previous file with comments | « base/prefs/json_pref_store_unittest.cc ('k') | base/task_runner_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698