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

Unified Diff: chrome/browser/chromeos/drive/sync/remove_performer_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/sync/remove_performer_unittest.cc
diff --git a/chrome/browser/chromeos/drive/sync/remove_performer_unittest.cc b/chrome/browser/chromeos/drive/sync/remove_performer_unittest.cc
index daec210902e6ea9f4c09cb12fb35562020888e12..8eac4e998df628040294cd7d885cb63845dbf571 100644
--- a/chrome/browser/chromeos/drive/sync/remove_performer_unittest.cc
+++ b/chrome/browser/chromeos/drive/sync/remove_performer_unittest.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/chromeos/drive/job_scheduler.h"
#include "chrome/browser/chromeos/drive/resource_metadata.h"
#include "chrome/browser/drive/fake_drive_service.h"
+#include "content/public/test/test_utils.h"
#include "google_apis/drive/drive_api_parser.h"
#include "google_apis/drive/test_util.h"
@@ -33,7 +34,7 @@ TEST_F(RemovePerformerTest, RemoveFile) {
performer.Remove(entry.local_id(),
ClientContext(USER_INITIATED),
google_apis::test_util::CreateCopyResultCallback(&error));
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
EXPECT_EQ(FILE_ERROR_OK, error);
// Remove a file in subdirectory.
@@ -44,7 +45,7 @@ TEST_F(RemovePerformerTest, RemoveFile) {
performer.Remove(entry.local_id(),
ClientContext(USER_INITIATED),
google_apis::test_util::CreateCopyResultCallback(&error));
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
EXPECT_EQ(FILE_ERROR_OK, error);
// Verify the file is indeed removed in the server.
@@ -54,7 +55,7 @@ TEST_F(RemovePerformerTest, RemoveFile) {
resource_id,
google_apis::test_util::CreateCopyResultCallback(&gdata_error,
&gdata_entry));
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
ASSERT_EQ(google_apis::HTTP_SUCCESS, gdata_error);
EXPECT_TRUE(gdata_entry->labels().is_trashed());
@@ -63,7 +64,7 @@ TEST_F(RemovePerformerTest, RemoveFile) {
performer.Remove("non-existing-id",
ClientContext(USER_INITIATED),
google_apis::test_util::CreateCopyResultCallback(&error));
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
EXPECT_EQ(FILE_ERROR_NOT_FOUND, error);
}
@@ -87,7 +88,7 @@ TEST_F(RemovePerformerTest, RemoveShared) {
true, // shared_with_me,
google_apis::test_util::CreateCopyResultCallback(&gdata_error,
&gdata_entry));
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
ASSERT_EQ(google_apis::HTTP_CREATED, gdata_error);
CheckForUpdates();
@@ -98,7 +99,7 @@ TEST_F(RemovePerformerTest, RemoveShared) {
performer.Remove(entry.local_id(),
ClientContext(USER_INITIATED),
google_apis::test_util::CreateCopyResultCallback(&error));
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
EXPECT_EQ(FILE_ERROR_OK, error);
EXPECT_EQ(FILE_ERROR_NOT_FOUND,
GetLocalResourceEntry(kPathInMyDrive, &entry));
@@ -111,7 +112,7 @@ TEST_F(RemovePerformerTest, RemoveShared) {
resource_id,
google_apis::test_util::CreateCopyResultCallback(&gdata_error,
&gdata_entry));
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
ASSERT_EQ(google_apis::HTTP_SUCCESS, gdata_error);
EXPECT_FALSE(gdata_entry->labels().is_trashed()); // It's not deleted.
EXPECT_TRUE(gdata_entry->parents().empty());
@@ -136,13 +137,13 @@ TEST_F(RemovePerformerTest, RemoveLocallyCreatedFile) {
entry,
&local_id),
google_apis::test_util::CreateCopyResultCallback(&error));
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
EXPECT_EQ(FILE_ERROR_OK, error);
// Remove the entry.
performer.Remove(local_id, ClientContext(USER_INITIATED),
google_apis::test_util::CreateCopyResultCallback(&error));
- test_util::RunBlockingPoolTask();
+ content::RunAllBlockingPoolTasksUntilIdle();
EXPECT_EQ(FILE_ERROR_OK, error);
EXPECT_EQ(FILE_ERROR_NOT_FOUND, GetLocalResourceEntryById(local_id, &entry));
}
« no previous file with comments | « chrome/browser/chromeos/drive/sync/entry_update_performer_unittest.cc ('k') | chrome/browser/chromeos/drive/test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698