diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-16 01:06:36 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-16 01:06:36 +0000 |
commit | 4e1c7e5b8474fb2bbe8696fc27bed597cab2a784 (patch) | |
tree | 174c6dbf14d169dab1b3eadcb5e416ee637a59ee /webkit/fileapi | |
parent | 82c58589a5bcb4666fd235f461df23858b29462e (diff) | |
download | chromium_src-4e1c7e5b8474fb2bbe8696fc27bed597cab2a784.zip chromium_src-4e1c7e5b8474fb2bbe8696fc27bed597cab2a784.tar.gz chromium_src-4e1c7e5b8474fb2bbe8696fc27bed597cab2a784.tar.bz2 |
webkit: Update the calls from RunAllPending() to RunUntilIdle().
RunAllPending() is deprecated and we should switch to RunUntilIdle().
BUG=131220
TBR=darin@chromium.org
Review URL: https://chromiumcodereview.appspot.com/11595003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173357 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi')
15 files changed, 114 insertions, 114 deletions
diff --git a/webkit/fileapi/file_system_dir_url_request_job_unittest.cc b/webkit/fileapi/file_system_dir_url_request_job_unittest.cc index 3d24205..029b00e 100644 --- a/webkit/fileapi/file_system_dir_url_request_job_unittest.cc +++ b/webkit/fileapi/file_system_dir_url_request_job_unittest.cc @@ -62,7 +62,7 @@ class FileSystemDirURLRequestJobTest : public testing::Test { GURL("http://remote/"), kFileSystemTypeTemporary, true, // create base::Bind(&FileSystemDirURLRequestJobTest::OnValidateFileSystem, weak_factory_.GetWeakPtr())); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); net::URLRequest::Deprecated::RegisterProtocolFactory( "filesystem", &FileSystemDirURLRequestJobFactory); @@ -287,7 +287,7 @@ TEST_F(FileSystemDirURLRequestJobTest, Cancel) { TestRequestNoRun(CreateFileSystemURL("foo/")); // Run StartAsync() and only StartAsync(). MessageLoop::current()->DeleteSoon(FROM_HERE, request_.release()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); // If we get here, success! we didn't crash! } diff --git a/webkit/fileapi/file_system_file_stream_reader_unittest.cc b/webkit/fileapi/file_system_file_stream_reader_unittest.cc index c2de0cd..456e30d 100644 --- a/webkit/fileapi/file_system_file_stream_reader_unittest.cc +++ b/webkit/fileapi/file_system_file_stream_reader_unittest.cc @@ -80,14 +80,14 @@ class FileSystemFileStreamReaderTest : public testing::Test { file_system_context_->sandbox_provider()->ValidateFileSystemRoot( GURL(kURLOrigin), kFileSystemTypeTemporary, true, // create base::Bind(&OnValidateFileSystem)); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); WriteFile(kTestFileName, kTestData, kTestDataSize, &test_file_modification_time_); } virtual void TearDown() OVERRIDE { - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); } protected: diff --git a/webkit/fileapi/file_system_quota_client_unittest.cc b/webkit/fileapi/file_system_quota_client_unittest.cc index 4dc3383..9ca9666 100644 --- a/webkit/fileapi/file_system_quota_client_unittest.cc +++ b/webkit/fileapi/file_system_quota_client_unittest.cc @@ -81,7 +81,7 @@ class FileSystemQuotaClientTest : public testing::Test { const std::string& origin_url, quota::StorageType type) { GetOriginUsageAsync(quota_client, origin_url, type); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); return usage_; } @@ -92,7 +92,7 @@ class FileSystemQuotaClientTest : public testing::Test { type, base::Bind(&FileSystemQuotaClientTest::OnGetOrigins, weak_factory_.GetWeakPtr())); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); return origins_; } @@ -104,7 +104,7 @@ class FileSystemQuotaClientTest : public testing::Test { type, host, base::Bind(&FileSystemQuotaClientTest::OnGetOrigins, weak_factory_.GetWeakPtr())); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); return origins_; } @@ -437,7 +437,7 @@ TEST_F(FileSystemQuotaClientTest, GetUsage_MultipleTasks) { GetOriginUsageAsync(quota_client.get(), kDummyURL1, kTemporary); RunAdditionalOriginUsageTask(quota_client.get(), kDummyURL1, kTemporary); RunAdditionalOriginUsageTask(quota_client.get(), kDummyURL1, kTemporary); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(11 + 22 + file_paths_cost, usage()); EXPECT_EQ(2, additional_callback_count()); @@ -446,7 +446,7 @@ TEST_F(FileSystemQuotaClientTest, GetUsage_MultipleTasks) { RunAdditionalOriginUsageTask(quota_client.get(), kDummyURL1, kTemporary); GetOriginUsageAsync(quota_client.get(), kDummyURL1, kTemporary); RunAdditionalOriginUsageTask(quota_client.get(), kDummyURL1, kTemporary); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(11 + 22 + file_paths_cost, usage()); EXPECT_EQ(2, additional_callback_count()); } @@ -548,15 +548,15 @@ TEST_F(FileSystemQuotaClientTest, DeleteOriginTest) { "https://bar.com/", kPersistent); DeleteOriginData(quota_client.get(), "http://foo.com/", kTemporary); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(quota::kQuotaStatusOk, status()); DeleteOriginData(quota_client.get(), "http://bar.com/", kPersistent); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(quota::kQuotaStatusOk, status()); DeleteOriginData(quota_client.get(), "http://buz.com/", kTemporary); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(quota::kQuotaStatusOk, status()); EXPECT_EQ(0, GetOriginUsage( diff --git a/webkit/fileapi/file_system_url_request_job_unittest.cc b/webkit/fileapi/file_system_url_request_job_unittest.cc index b0091dc..0efb40a 100644 --- a/webkit/fileapi/file_system_url_request_job_unittest.cc +++ b/webkit/fileapi/file_system_url_request_job_unittest.cc @@ -73,7 +73,7 @@ class FileSystemURLRequestJobTest : public testing::Test { GURL("http://remote/"), kFileSystemTypeTemporary, true, // create base::Bind(&FileSystemURLRequestJobTest::OnValidateFileSystem, weak_factory_.GetWeakPtr())); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); net::URLRequest::Deprecated::RegisterProtocolFactory( "filesystem", &FileSystemURLRequestJobFactory); @@ -87,7 +87,7 @@ class FileSystemURLRequestJobTest : public testing::Test { pending_job_ = NULL; } // FileReader posts a task to close the file in destructor. - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); } void OnValidateFileSystem(base::PlatformFileError result) { @@ -341,7 +341,7 @@ TEST_F(FileSystemURLRequestJobTest, Cancel) { // Run StartAsync() and only StartAsync(). MessageLoop::current()->DeleteSoon(FROM_HERE, request_.release()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); // If we get here, success! we didn't crash! } diff --git a/webkit/fileapi/local_file_stream_writer_unittest.cc b/webkit/fileapi/local_file_stream_writer_unittest.cc index 2a7fa68..3fda6d6 100644 --- a/webkit/fileapi/local_file_stream_writer_unittest.cc +++ b/webkit/fileapi/local_file_stream_writer_unittest.cc @@ -82,7 +82,7 @@ TEST_F(LocalFileStreamWriterTest, Write) { EXPECT_EQ(net::OK, WriteStringToWriter(writer.get(), "foo")); EXPECT_EQ(net::OK, WriteStringToWriter(writer.get(), "bar")); writer.reset(); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(file_util::PathExists(path)); EXPECT_EQ("foobar", GetFileContent(path)); } @@ -92,7 +92,7 @@ TEST_F(LocalFileStreamWriterTest, WriteMiddle) { scoped_ptr<LocalFileStreamWriter> writer(new LocalFileStreamWriter(path, 2)); EXPECT_EQ(net::OK, WriteStringToWriter(writer.get(), "xxx")); writer.reset(); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(file_util::PathExists(path)); EXPECT_EQ("foxxxr", GetFileContent(path)); } @@ -102,7 +102,7 @@ TEST_F(LocalFileStreamWriterTest, WriteEnd) { scoped_ptr<LocalFileStreamWriter> writer(new LocalFileStreamWriter(path, 6)); EXPECT_EQ(net::OK, WriteStringToWriter(writer.get(), "xxx")); writer.reset(); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(file_util::PathExists(path)); EXPECT_EQ("foobarxxx", GetFileContent(path)); } @@ -113,7 +113,7 @@ TEST_F(LocalFileStreamWriterTest, WriteFailForNonexistingFile) { scoped_ptr<LocalFileStreamWriter> writer(new LocalFileStreamWriter(path, 0)); EXPECT_EQ(net::ERR_FILE_NOT_FOUND, WriteStringToWriter(writer.get(), "foo")); writer.reset(); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_FALSE(file_util::PathExists(path)); } @@ -135,7 +135,7 @@ TEST_F(LocalFileStreamWriterTest, CancelAfterFinishedOperation) { EXPECT_EQ(net::ERR_UNEXPECTED, cancel_result); writer.reset(); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); // Write operation is already completed. EXPECT_TRUE(file_util::PathExists(path)); EXPECT_EQ("foo", GetFileContent(path)); diff --git a/webkit/fileapi/local_file_system_operation_unittest.cc b/webkit/fileapi/local_file_system_operation_unittest.cc index 1fe046a..cd66c5b 100644 --- a/webkit/fileapi/local_file_system_operation_unittest.cc +++ b/webkit/fileapi/local_file_system_operation_unittest.cc @@ -232,7 +232,7 @@ class LocalFileSystemOperationTest test_helper_.storage_type(), base::Bind(&LocalFileSystemOperationTest::DidGetUsageAndQuota, &status, usage, quota)); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); ASSERT_EQ(quota::kQuotaStatusOk, status); } @@ -246,7 +246,7 @@ class LocalFileSystemOperationTest false /* recursive */, base::Bind(&AssertFileErrorEq, base::PLATFORM_FILE_OK)); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); int64 total_usage; GetUsageAndQuota(&total_usage, NULL); @@ -324,7 +324,7 @@ TEST_F(LocalFileSystemOperationTest, TestMoveFailureSrcDoesntExist) { FileSystemURL dest(URLForPath(FilePath(FILE_PATH_LITERAL("b")))); change_observer()->ResetCount(); operation()->Move(src, dest, RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -334,7 +334,7 @@ TEST_F(LocalFileSystemOperationTest, TestMoveFailureContainsPath) { FilePath dest_dir_path(CreateUniqueDirInDir(src_dir_path)); operation()->Move(URLForPath(src_dir_path), URLForPath(dest_dir_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_INVALID_OPERATION, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -347,7 +347,7 @@ TEST_F(LocalFileSystemOperationTest, TestMoveFailureSrcDirExistsDestFile) { operation()->Move(URLForPath(src_dir_path), URLForPath(dest_file_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_INVALID_OPERATION, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -361,7 +361,7 @@ TEST_F(LocalFileSystemOperationTest, operation()->Move(URLForPath(src_dir_path), URLForPath(dest_dir_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_EMPTY, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -374,7 +374,7 @@ TEST_F(LocalFileSystemOperationTest, TestMoveFailureSrcFileExistsDestDir) { operation()->Move(URLForPath(src_file_path), URLForPath(dest_dir_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_INVALID_OPERATION, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -387,7 +387,7 @@ TEST_F(LocalFileSystemOperationTest, TestMoveFailureDestParentDoesntExist) { operation()->Move(URLForPath(src_dir_path), URLForPath(nonexisting_file), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -400,7 +400,7 @@ TEST_F(LocalFileSystemOperationTest, TestMoveSuccessSrcFileAndOverwrite) { operation()->Move(URLForPath(src_file_path), URLForPath(dest_file_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(FileExists(dest_file_path)); @@ -421,7 +421,7 @@ TEST_F(LocalFileSystemOperationTest, TestMoveSuccessSrcFileAndNew) { operation()->Move(URLForPath(src_file_path), URLForPath(dest_file_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(FileExists(dest_file_path)); @@ -436,7 +436,7 @@ TEST_F(LocalFileSystemOperationTest, TestMoveSuccessSrcDirAndOverwrite) { operation()->Move(URLForPath(src_dir_path), URLForPath(dest_dir_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_FALSE(DirectoryExists(src_dir_path)); @@ -458,7 +458,7 @@ TEST_F(LocalFileSystemOperationTest, TestMoveSuccessSrcDirAndNew) { operation()->Move(URLForPath(src_dir_path), URLForPath(dest_child_dir_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_FALSE(DirectoryExists(src_dir_path)); EXPECT_TRUE(DirectoryExists(dest_child_dir_path)); @@ -478,7 +478,7 @@ TEST_F(LocalFileSystemOperationTest, TestMoveSuccessSrcDirRecursive) { operation()->Move(URLForPath(src_dir_path), URLForPath(dest_dir_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(DirectoryExists(dest_dir_path.Append( VirtualPath::BaseName(child_dir_path)))); @@ -497,7 +497,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopyFailureSrcDoesntExist) { operation()->Copy(URLForPath(FilePath(FILE_PATH_LITERAL("a"))), URLForPath(FilePath(FILE_PATH_LITERAL("b"))), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -507,7 +507,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopyFailureContainsPath) { FilePath dest_dir_path(CreateUniqueDirInDir(src_dir_path)); operation()->Copy(URLForPath(src_dir_path), URLForPath(dest_dir_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_INVALID_OPERATION, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -520,7 +520,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopyFailureSrcDirExistsDestFile) { operation()->Copy(URLForPath(src_dir_path), URLForPath(dest_file_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_INVALID_OPERATION, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -534,7 +534,7 @@ TEST_F(LocalFileSystemOperationTest, operation()->Copy(URLForPath(src_dir_path), URLForPath(dest_dir_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_EMPTY, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -547,7 +547,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopyFailureSrcFileExistsDestDir) { operation()->Copy(URLForPath(src_file_path), URLForPath(dest_dir_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_INVALID_OPERATION, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -563,7 +563,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopyFailureDestParentDoesntExist) { operation()->Copy(URLForPath(src_dir_path), URLForPath(nonexisting_file_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -584,7 +584,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopyFailureByQuota) { operation()->Truncate(URLForPath(src_file_path), 6, RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); AddQuota(6 + dest_path_cost - 1); @@ -594,7 +594,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopyFailureByQuota) { operation()->Copy(URLForPath(src_file_path), URLForPath(dest_file_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, status()); EXPECT_FALSE(FileExists(dest_file_path)); } @@ -607,7 +607,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopySuccessSrcFileAndOverwrite) { operation()->Copy(URLForPath(src_file_path), URLForPath(dest_file_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(FileExists(dest_file_path)); EXPECT_EQ(1, quota_manager_proxy()->notify_storage_accessed_count()); @@ -624,7 +624,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopySuccessSrcFileAndNew) { operation()->Copy(URLForPath(src_file_path), URLForPath(dest_file_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(FileExists(dest_file_path)); EXPECT_EQ(1, quota_manager_proxy()->notify_storage_accessed_count()); @@ -639,7 +639,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopySuccessSrcDirAndOverwrite) { operation()->Copy(URLForPath(src_dir_path), URLForPath(dest_dir_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); // Make sure we've overwritten but not copied the source under the |dest_dir|. @@ -661,7 +661,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopySuccessSrcDirAndNew) { operation()->Copy(URLForPath(src_dir_path), URLForPath(dest_child_dir_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(DirectoryExists(dest_child_dir_path)); EXPECT_EQ(1, quota_manager_proxy()->notify_storage_accessed_count()); @@ -679,7 +679,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopySuccessSrcDirRecursive) { FilePath dest_dir_path(CreateUniqueDir()); operation()->Copy(URLForPath(src_dir_path), URLForPath(dest_dir_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(DirectoryExists(dest_dir_path.Append( VirtualPath::BaseName(child_dir_path)))); @@ -711,7 +711,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopyInForeignFileSuccess) { operation()->CopyInForeignFile(src_local_disk_file_path, dest_file_url, RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(1, change_observer()->create_file_count()); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(FileExists(dest_file_path)); @@ -746,7 +746,7 @@ TEST_F(LocalFileSystemOperationTest, TestCopyInForeignFileFailureByQuota) { operation()->CopyInForeignFile(src_local_disk_file_path, dest_file_url, RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(!FileExists(dest_file_path)); EXPECT_EQ(0, change_observer()->create_file_count()); @@ -759,7 +759,7 @@ TEST_F(LocalFileSystemOperationTest, TestCreateFileFailure) { FilePath file_path(CreateUniqueFileInDir(dir_path)); operation()->CreateFile(URLForPath(file_path), true, RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_EXISTS, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -770,7 +770,7 @@ TEST_F(LocalFileSystemOperationTest, TestCreateFileSuccessFileExists) { FilePath file_path(CreateUniqueFileInDir(dir_path)); operation()->CreateFile(URLForPath(file_path), false, RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(FileExists(file_path)); @@ -784,7 +784,7 @@ TEST_F(LocalFileSystemOperationTest, TestCreateFileSuccessExclusive) { FilePath file_path(dir_path.Append(FILE_PATH_LITERAL("FileDoesntExist"))); operation()->CreateFile(URLForPath(file_path), true, RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(FileExists(file_path)); EXPECT_EQ(1, change_observer()->get_and_reset_create_file_count()); @@ -796,7 +796,7 @@ TEST_F(LocalFileSystemOperationTest, TestCreateFileSuccessFileDoesntExist) { FilePath file_path(dir_path.Append(FILE_PATH_LITERAL("FileDoesntExist"))); operation()->CreateFile(URLForPath(file_path), false, RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_EQ(1, change_observer()->get_and_reset_create_file_count()); } @@ -810,7 +810,7 @@ TEST_F(LocalFileSystemOperationTest, FILE_PATH_LITERAL("FileDoesntExist"))); operation()->CreateDirectory(URLForPath(nonexisting_file_path), false, false, RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -820,7 +820,7 @@ TEST_F(LocalFileSystemOperationTest, TestCreateDirFailureDirExists) { FilePath src_dir_path(CreateUniqueDir()); operation()->CreateDirectory(URLForPath(src_dir_path), true, false, RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_EXISTS, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -831,7 +831,7 @@ TEST_F(LocalFileSystemOperationTest, TestCreateDirFailureFileExists) { FilePath file_path(CreateUniqueFileInDir(dir_path)); operation()->CreateDirectory(URLForPath(file_path), true, false, RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_EXISTS, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -841,7 +841,7 @@ TEST_F(LocalFileSystemOperationTest, TestCreateDirSuccess) { FilePath dir_path(CreateUniqueDir()); operation()->CreateDirectory(URLForPath(dir_path), false, false, RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(change_observer()->HasNoChange()); @@ -850,7 +850,7 @@ TEST_F(LocalFileSystemOperationTest, TestCreateDirSuccess) { FILE_PATH_LITERAL("nonexistingdir"))); operation()->CreateDirectory(URLForPath(nonexisting_dir_path), false, false, RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(DirectoryExists(nonexisting_dir_path)); EXPECT_EQ(1, change_observer()->get_and_reset_create_directory_count()); @@ -863,7 +863,7 @@ TEST_F(LocalFileSystemOperationTest, TestCreateDirSuccessExclusive) { operation()->CreateDirectory(URLForPath(nonexisting_dir_path), true, false, RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(DirectoryExists(nonexisting_dir_path)); EXPECT_EQ(1, change_observer()->get_and_reset_create_directory_count()); @@ -875,18 +875,18 @@ TEST_F(LocalFileSystemOperationTest, TestExistsAndMetadataFailure) { FILE_PATH_LITERAL("nonexistingdir"))); operation()->GetMetadata(URLForPath(nonexisting_dir_path), RecordMetadataCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); operation()->FileExists(URLForPath(nonexisting_dir_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); file_util::EnsureEndsWithSeparator(&nonexisting_dir_path); operation()->DirectoryExists(URLForPath(nonexisting_dir_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); EXPECT_TRUE(change_observer()->HasNoChange()); } @@ -897,12 +897,12 @@ TEST_F(LocalFileSystemOperationTest, TestExistsAndMetadataSuccess) { operation()->DirectoryExists(URLForPath(dir_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); ++read_access; operation()->GetMetadata(URLForPath(dir_path), RecordMetadataCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(info().is_directory); EXPECT_EQ(FilePath(), path()); @@ -910,12 +910,12 @@ TEST_F(LocalFileSystemOperationTest, TestExistsAndMetadataSuccess) { FilePath file_path(CreateUniqueFileInDir(dir_path)); operation()->FileExists(URLForPath(file_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); ++read_access; operation()->GetMetadata(URLForPath(file_path), RecordMetadataCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_FALSE(info().is_directory); EXPECT_EQ(PlatformPath(file_path), path()); @@ -929,13 +929,13 @@ TEST_F(LocalFileSystemOperationTest, TestExistsAndMetadataSuccess) { TEST_F(LocalFileSystemOperationTest, TestTypeMismatchErrors) { FilePath dir_path(CreateUniqueDir()); operation()->FileExists(URLForPath(dir_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_FILE, status()); FilePath file_path(CreateUniqueFileInDir(dir_path)); ASSERT_FALSE(file_path.empty()); operation()->DirectoryExists(URLForPath(file_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY, status()); } @@ -946,7 +946,7 @@ TEST_F(LocalFileSystemOperationTest, TestReadDirFailure) { file_util::EnsureEndsWithSeparator(&nonexisting_dir_path); operation()->ReadDirectory(URLForPath(nonexisting_dir_path), RecordReadDirectoryCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); // File exists. @@ -954,7 +954,7 @@ TEST_F(LocalFileSystemOperationTest, TestReadDirFailure) { FilePath file_path(CreateUniqueFileInDir(dir_path)); operation()->ReadDirectory(URLForPath(file_path), RecordReadDirectoryCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); // TODO(kkanetkar) crbug.com/54309 to change the error code. EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); EXPECT_TRUE(change_observer()->HasNoChange()); @@ -972,7 +972,7 @@ TEST_F(LocalFileSystemOperationTest, TestReadDirSuccess) { operation()->ReadDirectory(URLForPath(parent_dir_path), RecordReadDirectoryCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_EQ(2u, entries().size()); @@ -997,7 +997,7 @@ TEST_F(LocalFileSystemOperationTest, TestRemoveFailure) { operation()->Remove(URLForPath(nonexisting_path), false /* recursive */, RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_FOUND, status()); // It's an error to try to remove a non-empty directory if recursive flag @@ -1013,7 +1013,7 @@ TEST_F(LocalFileSystemOperationTest, TestRemoveFailure) { operation()->Remove(URLForPath(parent_dir_path), false /* recursive */, RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NOT_EMPTY, status()); EXPECT_TRUE(change_observer()->HasNoChange()); @@ -1025,7 +1025,7 @@ TEST_F(LocalFileSystemOperationTest, TestRemoveSuccess) { operation()->Remove(URLForPath(empty_dir_path), false /* recursive */, RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_FALSE(DirectoryExists(empty_dir_path)); @@ -1044,7 +1044,7 @@ TEST_F(LocalFileSystemOperationTest, TestRemoveSuccess) { operation()->Remove(URLForPath(parent_dir_path), true /* recursive */, RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_FALSE(DirectoryExists(parent_dir_path)); @@ -1068,7 +1068,7 @@ TEST_F(LocalFileSystemOperationTest, TestTruncate) { // Check that its length is the size of the data written. operation()->GetMetadata(URLForPath(file_path), RecordMetadataCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_FALSE(info().is_directory); EXPECT_EQ(data_size, info().size); @@ -1076,7 +1076,7 @@ TEST_F(LocalFileSystemOperationTest, TestTruncate) { // Extend the file by truncating it. int length = 17; operation()->Truncate(URLForPath(file_path), length, RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_EQ(1, change_observer()->get_and_reset_modify_file_count()); @@ -1100,7 +1100,7 @@ TEST_F(LocalFileSystemOperationTest, TestTruncate) { // Shorten the file by truncating it. length = 3; operation()->Truncate(URLForPath(file_path), length, RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_EQ(1, change_observer()->get_and_reset_modify_file_count()); @@ -1128,7 +1128,7 @@ TEST_F(LocalFileSystemOperationTest, TestTruncateFailureByQuota) { AddQuota(10); operation()->Truncate(URLForPath(file_path), 10, RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_EQ(1, change_observer()->get_and_reset_modify_file_count()); EXPECT_TRUE(change_observer()->HasNoChange()); @@ -1137,7 +1137,7 @@ TEST_F(LocalFileSystemOperationTest, TestTruncateFailureByQuota) { EXPECT_EQ(10, info.size); operation()->Truncate(URLForPath(file_path), 11, RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_ERROR_NO_SPACE, status()); EXPECT_TRUE(change_observer()->HasNoChange()); @@ -1166,7 +1166,7 @@ TEST_F(LocalFileSystemOperationTest, TestTouchFile) { operation()->TouchFile( URLForPath(file_path), new_accessed_time, new_modified_time, RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(change_observer()->HasNoChange()); @@ -1186,7 +1186,7 @@ TEST_F(LocalFileSystemOperationTest, TestCreateSnapshotFile) { RecordStatusCallback()); FilePath file_path(CreateUniqueFileInDir(dir_path)); operation()->FileExists(URLForPath(file_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); // See if we can get a 'snapshot' file info for the file. @@ -1195,7 +1195,7 @@ TEST_F(LocalFileSystemOperationTest, TestCreateSnapshotFile) { // as the file itself. operation()->CreateSnapshotFile(URLForPath(file_path), RecordSnapshotFileCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_FALSE(info().is_directory); EXPECT_EQ(PlatformPath(file_path), path()); diff --git a/webkit/fileapi/local_file_system_operation_write_unittest.cc b/webkit/fileapi/local_file_system_operation_write_unittest.cc index 6ba606d..4bf0ed0 100644 --- a/webkit/fileapi/local_file_system_operation_write_unittest.cc +++ b/webkit/fileapi/local_file_system_operation_write_unittest.cc @@ -313,7 +313,7 @@ TEST_F(LocalFileSystemOperationWriteTest, TestImmediateCancelSuccessfulWrite) { // We use RunAllPendings() instead of Run() here, because we won't dispatch // callbacks after Cancel() is issued (so no chance to Quit) nor do we need // to run another write cycle. - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); // Issued Cancel() before receiving any response from Write(), // so nothing should have happen. @@ -337,7 +337,7 @@ TEST_F(LocalFileSystemOperationWriteTest, TestImmediateCancelFailingWrite) { // We use RunAllPendings() instead of Run() here, because we won't dispatch // callbacks after Cancel() is issued (so no chance to Quit) nor do we need // to run another write cycle. - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); // Issued Cancel() before receiving any response from Write(), // so nothing should have happen. diff --git a/webkit/fileapi/local_file_system_quota_unittest.cc b/webkit/fileapi/local_file_system_quota_unittest.cc index e848afb..8ba84eb 100644 --- a/webkit/fileapi/local_file_system_quota_unittest.cc +++ b/webkit/fileapi/local_file_system_quota_unittest.cc @@ -96,7 +96,7 @@ class LocalFileSystemQuotaTest test_helper_.origin(), test_helper_.storage_type(), base::Bind(&LocalFileSystemQuotaTest::OnGetUsageAndQuota, weak_factory_.GetWeakPtr())); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); } bool FileExists(const FilePath& virtual_path) { @@ -243,7 +243,7 @@ TEST_F(LocalFileSystemQuotaTest, TestMoveSuccessSrcDirRecursive) { base::Bind(&AssertFileErrorEq, base::PLATFORM_FILE_OK)); operation()->Truncate(URLForPath(grandchild_file2_path_), 2, base::Bind(&AssertFileErrorEq, base::PLATFORM_FILE_OK)); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); const int64 all_file_size = 5000 + 400 + 30 + 2; @@ -256,7 +256,7 @@ TEST_F(LocalFileSystemQuotaTest, TestMoveSuccessSrcDirRecursive) { operation()->Move(URLForPath(src_dir_path), URLForPath(dest_dir_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); EXPECT_TRUE(DirectoryExists(dest_dir_path.Append( @@ -291,7 +291,7 @@ TEST_F(LocalFileSystemQuotaTest, TestCopySuccessSrcDirRecursive) { base::Bind(&AssertFileErrorEq, base::PLATFORM_FILE_OK)); operation()->Truncate(URLForPath(grandchild_file2_path_), 5, base::Bind(&AssertFileErrorEq, base::PLATFORM_FILE_OK)); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); const int64 child_file_size = 8000 + 700; const int64 grandchild_file_size = 60 + 5; @@ -307,7 +307,7 @@ TEST_F(LocalFileSystemQuotaTest, TestCopySuccessSrcDirRecursive) { operation()->Copy(URLForPath(src_dir_path), URLForPath(dest_dir1_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); expected_usage += all_file_size + child_path_cost_ + grandchild_path_cost_; @@ -333,7 +333,7 @@ TEST_F(LocalFileSystemQuotaTest, TestCopySuccessSrcDirRecursive) { operation()->Copy(URLForPath(child_dir_path_), URLForPath(dest_dir2_path), RecordStatusCallback()); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(base::PLATFORM_FILE_OK, status()); expected_usage += grandchild_file_size + grandchild_path_cost_; diff --git a/webkit/fileapi/local_file_system_test_helper.cc b/webkit/fileapi/local_file_system_test_helper.cc index 59a7d25..2de3aca3 100644 --- a/webkit/fileapi/local_file_system_test_helper.cc +++ b/webkit/fileapi/local_file_system_test_helper.cc @@ -105,7 +105,7 @@ void LocalFileSystemTestOriginHelper::SetUp( void LocalFileSystemTestOriginHelper::TearDown() { file_system_context_ = NULL; - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); } FilePath LocalFileSystemTestOriginHelper::GetOriginRootPath() const { diff --git a/webkit/fileapi/media/native_media_file_util_unittest.cc b/webkit/fileapi/media/native_media_file_util_unittest.cc index 6be9471..ff18801 100644 --- a/webkit/fileapi/media/native_media_file_util_unittest.cc +++ b/webkit/fileapi/media/native_media_file_util_unittest.cc @@ -174,7 +174,7 @@ TEST_F(NativeMediaFileUtilTest, DirectoryExistsAndFileExistsFiltering) { operation->DirectoryExists(url, base::Bind(&ExpectEqHelper, expectation)); else operation->FileExists(url, base::Bind(&ExpectEqHelper, expectation)); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); } } @@ -188,7 +188,7 @@ TEST_F(NativeMediaFileUtilTest, ReadDirectoryFiltering) { bool completed = false; NewOperation(url)->ReadDirectory( url, base::Bind(&DidReadDirectory, &content, &completed)); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(completed); EXPECT_EQ(5u, content.size()); diff --git a/webkit/fileapi/obfuscated_file_util_unittest.cc b/webkit/fileapi/obfuscated_file_util_unittest.cc index 0e5d1b7..349ee1c 100644 --- a/webkit/fileapi/obfuscated_file_util_unittest.cc +++ b/webkit/fileapi/obfuscated_file_util_unittest.cc @@ -215,7 +215,7 @@ class ObfuscatedFileUtilTest : public testing::Test { origin(), test_helper_.storage_type(), base::Bind(&ObfuscatedFileUtilTest::OnGetUsage, weak_factory_.GetWeakPtr())); - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(quota::kQuotaStatusOk, quota_status_); } diff --git a/webkit/fileapi/syncable/local_file_change_tracker_unittest.cc b/webkit/fileapi/syncable/local_file_change_tracker_unittest.cc index cc54e8c..6535131 100644 --- a/webkit/fileapi/syncable/local_file_change_tracker_unittest.cc +++ b/webkit/fileapi/syncable/local_file_change_tracker_unittest.cc @@ -50,7 +50,7 @@ class LocalFileChangeTrackerTest : public testing::Test { sync_context_->ShutdownOnUIThread(); sync_context_ = NULL; - message_loop_.RunAllPending(); + message_loop_.RunUntilIdle(); file_system_.TearDown(); // Make sure we don't leave the external filesystem. // (CannedSyncableFileSystem::TearDown does not do this as there may be diff --git a/webkit/fileapi/syncable/local_file_sync_context_unittest.cc b/webkit/fileapi/syncable/local_file_sync_context_unittest.cc index a61c141d..4335fca 100644 --- a/webkit/fileapi/syncable/local_file_sync_context_unittest.cc +++ b/webkit/fileapi/syncable/local_file_sync_context_unittest.cc @@ -167,7 +167,7 @@ class LocalFileSyncContextTest : public testing::Test { base::PlatformFileError WaitUntilModifyFileIsDone() { while (!async_modify_finished_) - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); return file_error_; } diff --git a/webkit/fileapi/syncable/syncable_file_operation_runner_unittest.cc b/webkit/fileapi/syncable/syncable_file_operation_runner_unittest.cc index dfa00f1..d2d7d7c 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_); } diff --git a/webkit/fileapi/syncable/syncable_file_system_util_unittest.cc b/webkit/fileapi/syncable/syncable_file_system_util_unittest.cc index f6a909c..b8d92f6 100644 --- a/webkit/fileapi/syncable/syncable_file_system_util_unittest.cc +++ b/webkit/fileapi/syncable/syncable_file_system_util_unittest.cc @@ -139,7 +139,7 @@ TEST(SyncableFileSystemUtilTest, SerializeBeforeOpenFileSystem) { RevokeSyncableFileSystem(kServiceName); sync_context->ShutdownOnUIThread(); sync_context = NULL; - MessageLoop::current()->RunAllPending(); + MessageLoop::current()->RunUntilIdle(); } } // namespace fileapi |