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

Unified Diff: chrome/browser/chromeos/drive/file_system/download_operation_unittest.cc

Issue 380993002: Upstream RunBlockingPoolTask(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed. Created 6 years, 5 months 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/chromeos/drive/file_system/download_operation_unittest.cc
diff --git a/chrome/browser/chromeos/drive/file_system/download_operation_unittest.cc b/chrome/browser/chromeos/drive/file_system/download_operation_unittest.cc
index 0bf6835cb159b6ee5c7cc8bf1deedc76ac7dd78b..0f3936238a6eebefdff8d942b52747753af3f920 100644
--- a/chrome/browser/chromeos/drive/file_system/download_operation_unittest.cc
+++ b/chrome/browser/chromeos/drive/file_system/download_operation_unittest.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/chromeos/drive/file_system_util.h"
#include "chrome/browser/chromeos/drive/job_scheduler.h"
#include "chrome/browser/drive/fake_drive_service.h"
+#include "content/public/test/test_utils.h"
#include "google_apis/drive/test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/cros_system_api/constants/cryptohome.h"
@@ -54,7 +55,7 @@ TEST_F(DownloadOperationTest,
google_apis::GetContentCallback(),
google_apis::test_util::CreateCopyResultCallback(
&error, &file_path, &entry));
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
EXPECT_EQ(FILE_ERROR_OK, error);
ASSERT_TRUE(entry);
@@ -83,7 +84,7 @@ TEST_F(DownloadOperationTest,
google_apis::GetContentCallback(),
google_apis::test_util::CreateCopyResultCallback(
&error, &file_path, &entry));
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
EXPECT_EQ(FILE_ERROR_NO_LOCAL_SPACE, error);
}
@@ -109,7 +110,7 @@ TEST_F(DownloadOperationTest,
google_apis::GetContentCallback(),
google_apis::test_util::CreateCopyResultCallback(
&error, &file_path, &entry));
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
EXPECT_EQ(FILE_ERROR_OK, error);
ASSERT_TRUE(entry);
EXPECT_TRUE(entry->file_specific_info().cache_state().is_present());
@@ -128,7 +129,7 @@ TEST_F(DownloadOperationTest,
google_apis::GetContentCallback(),
google_apis::test_util::CreateCopyResultCallback(
&error, &file_path, &entry));
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
EXPECT_EQ(FILE_ERROR_OK, error);
ASSERT_TRUE(entry);
@@ -174,7 +175,7 @@ TEST_F(DownloadOperationTest,
google_apis::GetContentCallback(),
google_apis::test_util::CreateCopyResultCallback(
&error, &file_path, &entry));
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
EXPECT_EQ(FILE_ERROR_NO_LOCAL_SPACE, error);
}
@@ -199,7 +200,7 @@ TEST_F(DownloadOperationTest, EnsureFileDownloadedByPath_FromCache) {
temp_file,
internal::FileCache::FILE_OPERATION_COPY),
google_apis::test_util::CreateCopyResultCallback(&error));
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
EXPECT_EQ(FILE_ERROR_OK, error);
base::FilePath file_path;
@@ -211,7 +212,7 @@ TEST_F(DownloadOperationTest, EnsureFileDownloadedByPath_FromCache) {
google_apis::GetContentCallback(),
google_apis::test_util::CreateCopyResultCallback(
&error, &file_path, &entry));
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
EXPECT_EQ(FILE_ERROR_OK, error);
ASSERT_TRUE(entry);
@@ -232,7 +233,7 @@ TEST_F(DownloadOperationTest, EnsureFileDownloadedByPath_HostedDocument) {
google_apis::GetContentCallback(),
google_apis::test_util::CreateCopyResultCallback(
&error, &file_path, &entry));
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
EXPECT_EQ(FILE_ERROR_OK, error);
ASSERT_TRUE(entry);
@@ -260,7 +261,7 @@ TEST_F(DownloadOperationTest, EnsureFileDownloadedByLocalId) {
google_apis::GetContentCallback(),
google_apis::test_util::CreateCopyResultCallback(
&error, &file_path, &entry));
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
EXPECT_EQ(FILE_ERROR_OK, error);
ASSERT_TRUE(entry);
@@ -290,7 +291,7 @@ TEST_F(DownloadOperationTest,
get_content_callback.callback(),
google_apis::test_util::CreateCopyResultCallback(
&completion_error, &local_path_dontcare, &entry_dontcare));
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
// For the first time, file is downloaded from the remote server.
// In this case, |local_path| is empty.
@@ -323,7 +324,7 @@ TEST_F(DownloadOperationTest,
get_content_callback.callback(),
google_apis::test_util::CreateCopyResultCallback(
&completion_error, &local_path_dontcare, &entry_dontcare));
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
// Try second download. In this case, the file should be cached, so
// |local_path| should not be empty.
@@ -360,7 +361,7 @@ TEST_F(DownloadOperationTest, EnsureFileDownloadedByLocalId_FromCache) {
temp_file,
internal::FileCache::FILE_OPERATION_COPY),
google_apis::test_util::CreateCopyResultCallback(&error));
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
EXPECT_EQ(FILE_ERROR_OK, error);
// The file is obtained from the cache.
@@ -376,7 +377,7 @@ TEST_F(DownloadOperationTest, EnsureFileDownloadedByLocalId_FromCache) {
google_apis::GetContentCallback(),
google_apis::test_util::CreateCopyResultCallback(
&error, &file_path, &entry));
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
EXPECT_EQ(FILE_ERROR_OK, error);
ASSERT_TRUE(entry);
@@ -407,7 +408,7 @@ TEST_F(DownloadOperationTest, EnsureFileDownloadedByPath_DirtyCache) {
dirty_file,
internal::FileCache::FILE_OPERATION_COPY),
google_apis::test_util::CreateCopyResultCallback(&error));
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
EXPECT_EQ(FILE_ERROR_OK, error);
// Record values passed to GetFileContentInitializedCallback().
@@ -424,7 +425,7 @@ TEST_F(DownloadOperationTest, EnsureFileDownloadedByPath_DirtyCache) {
google_apis::GetContentCallback(),
google_apis::test_util::CreateCopyResultCallback(
&error, &file_path, &entry));
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
EXPECT_EQ(FILE_ERROR_OK, error);
// Check that the result of local modification is propagated.
@@ -452,7 +453,7 @@ TEST_F(DownloadOperationTest, EnsureFileDownloadedByPath_LocallyCreatedFile) {
new_file,
&local_id),
google_apis::test_util::CreateCopyResultCallback(&error));
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
EXPECT_EQ(FILE_ERROR_OK, error);
// Empty cache file should be returned.
@@ -465,7 +466,7 @@ TEST_F(DownloadOperationTest, EnsureFileDownloadedByPath_LocallyCreatedFile) {
google_apis::GetContentCallback(),
google_apis::test_util::CreateCopyResultCallback(
&error, &cache_file_path, &entry));
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
EXPECT_EQ(FILE_ERROR_OK, error);
int64 cache_file_size = 0;
@@ -495,7 +496,7 @@ TEST_F(DownloadOperationTest, CancelBeforeDownloadStarts) {
// Cancel immediately.
ASSERT_FALSE(cancel_closure.is_null());
cancel_closure.Run();
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
EXPECT_EQ(FILE_ERROR_ABORT, error);
}

Powered by Google App Engine
This is Rietveld 408576698