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)); |
} |