Index: chrome/browser/google_apis/fake_drive_service_unittest.cc |
diff --git a/chrome/browser/google_apis/fake_drive_service_unittest.cc b/chrome/browser/google_apis/fake_drive_service_unittest.cc |
index 7a5b43d7e44a3493c25ec9ee9dba7771b249084b..4699e0045ad1fad053f867c059e4f58775cc1794 100644 |
--- a/chrome/browser/google_apis/fake_drive_service_unittest.cc |
+++ b/chrome/browser/google_apis/fake_drive_service_unittest.cc |
@@ -91,14 +91,6 @@ class FakeDriveServiceTest : public testing::Test { |
FakeDriveService fake_service_; |
}; |
-void AppendGetContentCallbackResult( |
- std::vector<std::string>* values, |
- GDataErrorCode error, |
- scoped_ptr<std::string> content) { |
- DCHECK_EQ(error, HTTP_SUCCESS); // Should always HTTP_SUCCESS. |
- values->push_back(*content); |
-} |
- |
void AppendProgressCallbackResult(std::vector<int64>* values, int64 progress) { |
values->push_back(progress); |
} |
@@ -864,13 +856,13 @@ TEST_F(FakeDriveServiceTest, DownloadFile_ExistingFile) { |
temp_dir.path().AppendASCII("whatever.txt"); |
GDataErrorCode error = GDATA_OTHER_ERROR; |
base::FilePath output_file_path; |
- std::vector<std::string> content_buffer; |
+ test_util::TestGetContentCallback get_content_callback; |
fake_service_.DownloadFile( |
base::FilePath::FromUTF8Unsafe("/drive/whatever.txt"), // virtual path |
kOutputFilePath, |
kContentUrl, |
test_util::CreateCopyResultCallback(&error, &output_file_path), |
- base::Bind(&AppendGetContentCallbackResult, &content_buffer), |
+ get_content_callback.callback(), |
base::Bind(&test_util::AppendProgressCallbackResult, |
&download_progress_values)); |
message_loop_.RunUntilIdle(); |
@@ -885,12 +877,7 @@ TEST_F(FakeDriveServiceTest, DownloadFile_ExistingFile) { |
EXPECT_TRUE(base::STLIsSorted(download_progress_values)); |
EXPECT_GE(download_progress_values.front().first, 0); |
EXPECT_LE(download_progress_values.back().first, 10); |
- |
- std::string concatenated_content; |
- for (size_t i = 0; i < content_buffer.size(); ++i) { |
- concatenated_content += content_buffer[i]; |
- } |
- EXPECT_EQ(content, concatenated_content); |
+ EXPECT_EQ(content, get_content_callback.GetConcatenatedData()); |
} |
TEST_F(FakeDriveServiceTest, DownloadFile_NonexistingFile) { |