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

Unified Diff: chrome/browser/chromeos/drive/drive_file_system_unittest.cc

Issue 12833019: Eliminate small CopyResultFromXxxCallback families in drive_test_util. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/drive_test_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/drive/drive_file_system_unittest.cc
diff --git a/chrome/browser/chromeos/drive/drive_file_system_unittest.cc b/chrome/browser/chromeos/drive/drive_file_system_unittest.cc
index fc80985a8ee673f4eb608f8353f23e2ee8561ce4..96340a1c1b8cea881ada4d759e58450ed11a6594 100644
--- a/chrome/browser/chromeos/drive/drive_file_system_unittest.cc
+++ b/chrome/browser/chromeos/drive/drive_file_system_unittest.cc
@@ -2081,8 +2081,8 @@ TEST_F(DriveFileSystemTest, GetAvailableSpace) {
int64 bytes_total;
int64 bytes_used;
file_system_->GetAvailableSpace(
- base::Bind(&test_util::CopyResultsFromGetAvailableSpaceCallback,
- &error, &bytes_total, &bytes_used));
+ google_apis::test_util::CreateCopyResultCallback(
+ &error, &bytes_total, &bytes_used));
google_apis::test_util::RunBlockingPoolTask();
EXPECT_EQ(GG_LONGLONG(6789012345), bytes_used);
EXPECT_EQ(GG_LONGLONG(9876543210), bytes_total);
@@ -2131,9 +2131,8 @@ TEST_F(DriveFileSystemTest, OpenAndCloseFile) {
base::FilePath file_path;
file_system_->OpenFile(
kFileInRoot,
- base::Bind(&test_util::CopyResultsFromOpenFileCallbackAndQuit,
- &error, &file_path));
- message_loop_.Run();
+ google_apis::test_util::CreateCopyResultCallback(&error, &file_path));
+ google_apis::test_util::RunBlockingPoolTask();
const base::FilePath opened_file_path = file_path;
// Verify that the file was properly opened.
@@ -2142,9 +2141,8 @@ TEST_F(DriveFileSystemTest, OpenAndCloseFile) {
// Try to open the already opened file.
file_system_->OpenFile(
kFileInRoot,
- base::Bind(&test_util::CopyResultsFromOpenFileCallbackAndQuit,
- &error, &file_path));
- message_loop_.Run();
+ google_apis::test_util::CreateCopyResultCallback(&error, &file_path));
+ google_apis::test_util::RunBlockingPoolTask();
// It must fail.
EXPECT_EQ(DRIVE_FILE_ERROR_IN_USE, error);
@@ -2174,9 +2172,8 @@ TEST_F(DriveFileSystemTest, OpenAndCloseFile) {
// Close kFileInRoot ("drive/File 1.txt").
file_system_->CloseFile(
kFileInRoot,
- base::Bind(&test_util::CopyResultsFromCloseFileCallbackAndQuit,
- &error));
- message_loop_.Run();
+ google_apis::test_util::CreateCopyResultCallback(&error));
+ google_apis::test_util::RunBlockingPoolTask();
// Verify that the file was properly closed.
EXPECT_EQ(DRIVE_FILE_OK, error);
@@ -2191,9 +2188,8 @@ TEST_F(DriveFileSystemTest, OpenAndCloseFile) {
// Try to close the same file twice.
file_system_->CloseFile(
kFileInRoot,
- base::Bind(&test_util::CopyResultsFromCloseFileCallbackAndQuit,
- &error));
- message_loop_.Run();
+ google_apis::test_util::CreateCopyResultCallback(&error));
+ google_apis::test_util::RunBlockingPoolTask();
// It must fail.
EXPECT_EQ(DRIVE_FILE_ERROR_NOT_FOUND, error);
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/drive_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698