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

Unified Diff: chrome/browser/download/download_path_reservation_tracker_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/download/download_path_reservation_tracker_unittest.cc
diff --git a/chrome/browser/download/download_path_reservation_tracker_unittest.cc b/chrome/browser/download/download_path_reservation_tracker_unittest.cc
index 304d875529a869ea4da347629e2d029b6aa28b72..cecfdbd38887e4d0cac0d5b8fd0dca6d94ef8a78 100644
--- a/chrome/browser/download/download_path_reservation_tracker_unittest.cc
+++ b/chrome/browser/download/download_path_reservation_tracker_unittest.cc
@@ -107,7 +107,7 @@ void DownloadPathReservationTrackerTest::SetUp() {
}
void DownloadPathReservationTrackerTest::TearDown() {
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
}
FakeDownloadItem* DownloadPathReservationTrackerTest::CreateDownloadItem(
@@ -146,7 +146,7 @@ void DownloadPathReservationTrackerTest::CallGetReservedPath(
base::Bind(&DownloadPathReservationTrackerTest::TestReservedPathCallback,
weak_ptr_factory.GetWeakPtr(), return_path, return_verified,
&did_run_callback));
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_TRUE(did_run_callback);
}
@@ -175,7 +175,7 @@ TEST_F(DownloadPathReservationTrackerTest, BasicReservation) {
// Destroying the item should release the reservation.
item.reset();
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_FALSE(IsPathInUse(path));
}
@@ -194,7 +194,7 @@ TEST_F(DownloadPathReservationTrackerTest, InterruptedDownload) {
// Once the download is interrupted, the path should become available again.
item->SetState(DownloadItem::INTERRUPTED);
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_FALSE(IsPathInUse(path));
}
@@ -216,7 +216,7 @@ TEST_F(DownloadPathReservationTrackerTest, CompleteDownload) {
// The path wouldn't be available since it is occupied on disk by the
// completed download.
item->SetState(DownloadItem::COMPLETE);
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_FALSE(IsPathInUse(path));
}
@@ -245,7 +245,7 @@ TEST_F(DownloadPathReservationTrackerTest, ConflictingFiles) {
reserved_path.value());
item.reset();
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_TRUE(IsPathInUse(path));
EXPECT_FALSE(IsPathInUse(reserved_path));
}
@@ -276,7 +276,7 @@ TEST_F(DownloadPathReservationTrackerTest, ConflictingReservations) {
EXPECT_TRUE(IsPathInUse(uniquified_path));
EXPECT_EQ(uniquified_path.value(), reserved_path2.value());
}
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_TRUE(IsPathInUse(path));
EXPECT_FALSE(IsPathInUse(uniquified_path));
@@ -290,7 +290,7 @@ TEST_F(DownloadPathReservationTrackerTest, ConflictingReservations) {
EXPECT_TRUE(IsPathInUse(uniquified_path));
EXPECT_EQ(uniquified_path.value(), reserved_path2.value());
}
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
// Now acquire an overwriting reservation. We should end up with the same
// non-uniquified path for both reservations.
@@ -405,7 +405,7 @@ TEST_F(DownloadPathReservationTrackerTest, UpdatesToTargetPath) {
// this state, we shouldn't lose the reservation.
ASSERT_EQ(FilePath::StringType(), item->GetTargetFilePath().value());
item->UpdateObservers();
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_TRUE(IsPathInUse(path));
// If the target path changes, we should update the reservation to match.
@@ -415,12 +415,12 @@ TEST_F(DownloadPathReservationTrackerTest, UpdatesToTargetPath) {
EXPECT_CALL(*item, GetTargetFilePath())
.WillRepeatedly(ReturnRef(new_target_path));
item->UpdateObservers();
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_FALSE(IsPathInUse(path));
EXPECT_TRUE(IsPathInUse(new_target_path));
// Destroying the item should release the reservation.
item.reset();
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
EXPECT_FALSE(IsPathInUse(new_target_path));
}

Powered by Google App Engine
This is Rietveld 408576698