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

Unified Diff: webkit/fileapi/syncable/syncable_file_operation_runner_unittest.cc

Issue 11595003: webkit: Update the calls from RunAllPending() to RunUntilIdle(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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: webkit/fileapi/syncable/syncable_file_operation_runner_unittest.cc
diff --git a/webkit/fileapi/syncable/syncable_file_operation_runner_unittest.cc b/webkit/fileapi/syncable/syncable_file_operation_runner_unittest.cc
index dfa00f1b20daa6f2549c2d1bc3920f9025cac584..d2d7d7cafc32966fb8c1a3aa4a2c4ced023a3d16 100644
--- a/webkit/fileapi/syncable/syncable_file_operation_runner_unittest.cc
+++ b/webkit/fileapi/syncable/syncable_file_operation_runner_unittest.cc
@@ -70,7 +70,7 @@ class SyncableFileOperationRunnerTest : public testing::Test {
sync_context_ = NULL;
file_system_.TearDown();
- message_loop_.RunAllPending();
+ message_loop_.RunUntilIdle();
RevokeSyncableFileSystem(kServiceName);
}
@@ -145,13 +145,13 @@ TEST_F(SyncableFileOperationRunnerTest, SimpleQueue) {
file_system_.NewOperation()->Truncate(
URL(kFile), 1,
ExpectStatus(FROM_HERE, base::PLATFORM_FILE_OK));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(0, callback_count_);
// Read operations are not blocked (and are executed before queued ones).
file_system_.NewOperation()->FileExists(
URL(kFile), ExpectStatus(FROM_HERE, base::PLATFORM_FILE_ERROR_NOT_FOUND));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(1, callback_count_);
// End syncing (to enable write).
@@ -159,14 +159,14 @@ TEST_F(SyncableFileOperationRunnerTest, SimpleQueue) {
ASSERT_TRUE(sync_status()->IsWritable(URL(kFile)));
ResetCallbackStatus();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(2, callback_count_);
// Now the file must have been created and updated.
ResetCallbackStatus();
file_system_.NewOperation()->FileExists(
URL(kFile), ExpectStatus(FROM_HERE, base::PLATFORM_FILE_OK));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(1, callback_count_);
}
@@ -186,13 +186,13 @@ TEST_F(SyncableFileOperationRunnerTest, WriteToParentAndChild) {
file_system_.NewOperation()->Remove(
URL(kParent), true /* recursive */,
ExpectStatus(FROM_HERE, base::PLATFORM_FILE_OK));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(0, callback_count_);
// Read operations are not blocked (and are executed before queued ones).
file_system_.NewOperation()->DirectoryExists(
URL(kDir), ExpectStatus(FROM_HERE, base::PLATFORM_FILE_OK));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(1, callback_count_);
// Writes to unrelated files must succeed as well.
@@ -200,7 +200,7 @@ TEST_F(SyncableFileOperationRunnerTest, WriteToParentAndChild) {
file_system_.NewOperation()->CreateDirectory(
URL(kOther), false /* exclusive */, false /* recursive */,
ExpectStatus(FROM_HERE, base::PLATFORM_FILE_OK));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(1, callback_count_);
// End syncing (to enable write).
@@ -208,7 +208,7 @@ TEST_F(SyncableFileOperationRunnerTest, WriteToParentAndChild) {
ASSERT_TRUE(sync_status()->IsWritable(URL(kDir)));
ResetCallbackStatus();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(2, callback_count_);
}
@@ -229,7 +229,7 @@ TEST_F(SyncableFileOperationRunnerTest, CopyAndMove) {
file_system_.NewOperation()->Move(
URL(kDir), URL("dest-move"),
ExpectStatus(FROM_HERE, base::PLATFORM_FILE_OK));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(1, callback_count_);
// Only "dest-copy1" should exist.
@@ -246,13 +246,13 @@ TEST_F(SyncableFileOperationRunnerTest, CopyAndMove) {
file_system_.NewOperation()->Copy(
URL(kDir), URL("dest-copy2"),
ExpectStatus(FROM_HERE, base::PLATFORM_FILE_OK));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(0, callback_count_);
// Finish syncing the "dest-copy2" directory to unlock Copy.
sync_status()->EndSyncing(URL("dest-copy2"));
ResetCallbackStatus();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(1, callback_count_);
// Now we should have "dest-copy2".
@@ -262,7 +262,7 @@ TEST_F(SyncableFileOperationRunnerTest, CopyAndMove) {
// Finish syncing the kParent to unlock Move.
sync_status()->EndSyncing(URL(kParent));
ResetCallbackStatus();
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(1, callback_count_);
// Now we should have "dest-move".
@@ -282,14 +282,14 @@ TEST_F(SyncableFileOperationRunnerTest, Write) {
file_system_.NewOperation()->Write(
&url_request_context_,
URL(kFile), kBlobURL, 0, GetWriteCallback(FROM_HERE));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(0, callback_count_);
sync_status()->EndSyncing(URL(kFile));
ResetCallbackStatus();
while (!write_complete_)
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(base::PLATFORM_FILE_OK, write_status_);
EXPECT_EQ(kData.size(), write_bytes_);
@@ -307,7 +307,7 @@ TEST_F(SyncableFileOperationRunnerTest, QueueAndCancel) {
file_system_.NewOperation()->Truncate(
URL(kFile), 1,
ExpectStatus(FROM_HERE, base::PLATFORM_FILE_ERROR_ABORT));
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(0, callback_count_);
ResetCallbackStatus();
@@ -315,7 +315,7 @@ TEST_F(SyncableFileOperationRunnerTest, QueueAndCancel) {
// This shouldn't crash nor leak memory.
sync_context_->ShutdownOnUIThread();
sync_context_ = NULL;
- MessageLoop::current()->RunAllPending();
+ MessageLoop::current()->RunUntilIdle();
EXPECT_EQ(2, callback_count_);
}

Powered by Google App Engine
This is Rietveld 408576698