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

Unified Diff: chrome/browser/google_apis/drive_uploader_unittest.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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/google_apis/drive_uploader_unittest.cc
diff --git a/chrome/browser/google_apis/drive_uploader_unittest.cc b/chrome/browser/google_apis/drive_uploader_unittest.cc
index 6b51b89f3d6074d926e41781b8842906504ff940..a3e6e6c9019656126f05736db48a72029c93b198 100644
--- a/chrome/browser/google_apis/drive_uploader_unittest.cc
+++ b/chrome/browser/google_apis/drive_uploader_unittest.cc
@@ -86,8 +86,8 @@ class MockDriveServiceWithUploadExpectation : public DummyDriveService {
// Calls back the upload URL for subsequent ResumeUpload operations.
// InitiateUpload is an asynchronous function, so don't callback directly.
- MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback, HTTP_SUCCESS, GURL(kTestUploadURL)));
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE, base::Bind(callback, HTTP_SUCCESS, GURL(kTestUploadURL)));
}
virtual void InitiateUploadExistingFile(
@@ -103,15 +103,15 @@ class MockDriveServiceWithUploadExpectation : public DummyDriveService {
EXPECT_EQ(kTestInitiateUploadResourceId, resource_id);
if (!etag.empty() && etag != kTestETag) {
- MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback, HTTP_PRECONDITION, GURL()));
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE, base::Bind(callback, HTTP_PRECONDITION, GURL()));
return;
}
// Calls back the upload URL for subsequent ResumeUpload operations.
// InitiateUpload is an asynchronous function, so don't callback directly.
- MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback, HTTP_SUCCESS, GURL(kTestUploadURL)));
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE, base::Bind(callback, HTTP_SUCCESS, GURL(kTestUploadURL)));
}
// Handles a request for uploading a chunk of bytes.
@@ -158,9 +158,10 @@ class MockDriveServiceWithUploadExpectation : public DummyDriveService {
if (!progress_callback.is_null()) {
// For the testing purpose, it always notifies the progress at the end of
// each chunk uploading.
- MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(progress_callback, expected_chunk_size,
- expected_chunk_size));
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE,
+ base::Bind(
+ progress_callback, expected_chunk_size, expected_chunk_size));
}
// Callback with response.
@@ -178,8 +179,8 @@ class MockDriveServiceWithUploadExpectation : public DummyDriveService {
response = UploadRangeResponse(HTTP_RESUME_INCOMPLETE, 0, end_position);
}
// ResumeUpload is an asynchronous function, so don't callback directly.
- MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback, response, base::Passed(&entry)));
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE, base::Bind(callback, response, base::Passed(&entry)));
}
std::string expected_upload_content_;
@@ -197,8 +198,8 @@ class MockDriveServiceNoConnectionAtInitiate : public DummyDriveService {
const std::string& parent_resource_id,
const std::string& title,
const InitiateUploadCallback& callback) OVERRIDE {
- MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback, GDATA_NO_CONNECTION, GURL()));
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE, base::Bind(callback, GDATA_NO_CONNECTION, GURL()));
}
virtual void InitiateUploadExistingFile(
@@ -208,8 +209,8 @@ class MockDriveServiceNoConnectionAtInitiate : public DummyDriveService {
const std::string& resource_id,
const std::string& etag,
const InitiateUploadCallback& callback) OVERRIDE {
- MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback, GDATA_NO_CONNECTION, GURL()));
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE, base::Bind(callback, GDATA_NO_CONNECTION, GURL()));
}
// Should not be used.
@@ -238,8 +239,8 @@ class MockDriveServiceNoConnectionAtResume : public DummyDriveService {
const std::string& parent_resource_id,
const std::string& title,
const InitiateUploadCallback& callback) OVERRIDE {
- MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback, HTTP_SUCCESS, GURL(kTestUploadURL)));
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE, base::Bind(callback, HTTP_SUCCESS, GURL(kTestUploadURL)));
}
virtual void InitiateUploadExistingFile(
@@ -249,8 +250,8 @@ class MockDriveServiceNoConnectionAtResume : public DummyDriveService {
const std::string& resource_id,
const std::string& etag,
const InitiateUploadCallback& callback) OVERRIDE {
- MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback, HTTP_SUCCESS, GURL(kTestUploadURL)));
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE, base::Bind(callback, HTTP_SUCCESS, GURL(kTestUploadURL)));
}
// Returns error.
@@ -265,7 +266,8 @@ class MockDriveServiceNoConnectionAtResume : public DummyDriveService {
const scoped_refptr<net::IOBuffer>& buf,
const UploadRangeCallback& callback,
const ProgressCallback& progress_callback) OVERRIDE {
- MessageLoop::current()->PostTask(FROM_HERE,
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE,
base::Bind(callback,
UploadRangeResponse(GDATA_NO_CONNECTION, -1, -1),
base::Passed(scoped_ptr<ResourceEntry>())));
@@ -287,7 +289,7 @@ class DriveUploaderTest : public testing::Test {
}
protected:
- MessageLoopForUI message_loop_;
+ base::MessageLoopForUI message_loop_;
content::TestBrowserThread ui_thread_;
base::ScopedTempDir temp_dir_;
};

Powered by Google App Engine
This is Rietveld 408576698