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

Unified Diff: chrome/browser/notifications/desktop_notifications_unittest.cc

Issue 11413050: chrome/browser: Update calls from RunAllPending() to RunUntilIdle(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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: chrome/browser/notifications/desktop_notifications_unittest.cc
diff --git a/chrome/browser/notifications/desktop_notifications_unittest.cc b/chrome/browser/notifications/desktop_notifications_unittest.cc
index 63026af6e04daa1723d75a9aaf01bd7f70033744..4a96e9f7eac0611bd7759f9a9614bca3a2ad7311 100644
--- a/chrome/browser/notifications/desktop_notifications_unittest.cc
+++ b/chrome/browser/notifications/desktop_notifications_unittest.cc
@@ -139,7 +139,7 @@ TEST_F(DesktopNotificationsTest, TestShow) {
EXPECT_TRUE(service_->ShowDesktopNotification(
params, 0, 0, DesktopNotificationService::PageNotification));
- MessageLoopForUI::current()->RunAllPending();
+ MessageLoopForUI::current()->RunUntilIdle();
EXPECT_EQ(1, balloon_collection_->count());
content::ShowDesktopNotificationHostMsgParams params2;
@@ -150,7 +150,7 @@ TEST_F(DesktopNotificationsTest, TestShow) {
EXPECT_TRUE(service_->ShowDesktopNotification(
params2, 0, 0, DesktopNotificationService::PageNotification));
- MessageLoopForUI::current()->RunAllPending();
+ MessageLoopForUI::current()->RunUntilIdle();
EXPECT_EQ(2, balloon_collection_->count());
EXPECT_EQ("notification displayed\n"
@@ -166,7 +166,7 @@ TEST_F(DesktopNotificationsTest, TestClose) {
// Request a notification; should open a balloon.
EXPECT_TRUE(service_->ShowDesktopNotification(
params, 0, 0, DesktopNotificationService::PageNotification));
- MessageLoopForUI::current()->RunAllPending();
+ MessageLoopForUI::current()->RunUntilIdle();
EXPECT_EQ(1, balloon_collection_->count());
// Close all the open balloons.
@@ -192,14 +192,14 @@ TEST_F(DesktopNotificationsTest, TestCancel) {
EXPECT_TRUE(service_->ShowDesktopNotification(
params, process_id, route_id,
DesktopNotificationService::PageNotification));
- MessageLoopForUI::current()->RunAllPending();
+ MessageLoopForUI::current()->RunUntilIdle();
EXPECT_EQ(1, balloon_collection_->count());
// Cancel the same notification
service_->CancelDesktopNotification(process_id,
route_id,
notification_id);
- MessageLoopForUI::current()->RunAllPending();
+ MessageLoopForUI::current()->RunUntilIdle();
// Verify that the balloon collection is now empty.
EXPECT_EQ(0, balloon_collection_->count());
@@ -287,7 +287,7 @@ TEST_F(DesktopNotificationsTest, TestQueueing) {
params, process_id, route_id,
DesktopNotificationService::PageNotification));
}
- MessageLoopForUI::current()->RunAllPending();
+ MessageLoopForUI::current()->RunUntilIdle();
// Build up an expected log of what should be happening.
std::string expected_log;
@@ -309,7 +309,7 @@ TEST_F(DesktopNotificationsTest, TestQueueing) {
id <= kLotsOfToasts - balloon_collection_->max_balloon_count();
++id) {
service_->CancelDesktopNotification(process_id, route_id, id);
- MessageLoopForUI::current()->RunAllPending();
+ MessageLoopForUI::current()->RunUntilIdle();
expected_log.append("notification closed by script\n");
expected_log.append("notification displayed\n");
EXPECT_EQ(balloon_collection_->max_balloon_count(),
@@ -321,7 +321,7 @@ TEST_F(DesktopNotificationsTest, TestQueueing) {
for (; id <= kLotsOfToasts; ++id) {
service_->CancelDesktopNotification(process_id, route_id, id);
expected_log.append("notification closed by script\n");
- MessageLoopForUI::current()->RunAllPending();
+ MessageLoopForUI::current()->RunUntilIdle();
EXPECT_EQ(expected_log, log_output_);
}
}
@@ -354,7 +354,7 @@ TEST_F(DesktopNotificationsTest, TestUserInputEscaping) {
EXPECT_TRUE(service_->ShowDesktopNotification(
params, 0, 0, DesktopNotificationService::PageNotification));
- MessageLoopForUI::current()->RunAllPending();
+ MessageLoopForUI::current()->RunUntilIdle();
EXPECT_EQ(1, balloon_collection_->count());
Balloon* balloon = (*balloon_collection_->balloons().begin());
GURL data_url = balloon->notification().content_url();
« no previous file with comments | « chrome/browser/net/transport_security_persister_unittest.cc ('k') | chrome/browser/page_cycler/page_cycler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698