summaryrefslogtreecommitdiffstats
path: root/chrome/browser/drive
diff options
context:
space:
mode:
authorhirono <hirono@chromium.org>2014-12-17 20:32:48 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-18 04:33:10 +0000
commit42f85d1ac324e3169268cf638d378e01fee93e63 (patch)
tree3bdbde28d34dcd8e0b69c93f7e7fd2aa3c9d1d2d /chrome/browser/drive
parent9debecdac0a388cc60554e4e4dee95eae9270515 (diff)
downloadchromium_src-42f85d1ac324e3169268cf638d378e01fee93e63.zip
chromium_src-42f85d1ac324e3169268cf638d378e01fee93e63.tar.gz
chromium_src-42f85d1ac324e3169268cf638d378e01fee93e63.tar.bz2
drive: Add definitions of MultipartUpload methods to DriveServiceInterface.
* Adds two methods MultipartUploadNewFile and MultipartUploadExistingFile. * Rename InitiateUploadNewFileOptions and InitiateUploadExistingFileOptions to UploadNewFileOptions and UploadExistingFileOptions. BUG=269922 TEST=None Review URL: https://codereview.chromium.org/804393003 Cr-Commit-Position: refs/heads/master@{#308949}
Diffstat (limited to 'chrome/browser/drive')
-rw-r--r--chrome/browser/drive/drive_api_service.cc35
-rw-r--r--chrome/browser/drive/drive_api_service.h21
-rw-r--r--chrome/browser/drive/drive_service_interface.cc12
-rw-r--r--chrome/browser/drive/drive_service_interface.h49
-rw-r--r--chrome/browser/drive/drive_uploader.h5
-rw-r--r--chrome/browser/drive/drive_uploader_unittest.cc12
-rw-r--r--chrome/browser/drive/dummy_drive_service.cc35
-rw-r--r--chrome/browser/drive/dummy_drive_service.h21
-rw-r--r--chrome/browser/drive/fake_drive_service.cc35
-rw-r--r--chrome/browser/drive/fake_drive_service.h21
-rw-r--r--chrome/browser/drive/fake_drive_service_unittest.cc66
11 files changed, 226 insertions, 86 deletions
diff --git a/chrome/browser/drive/drive_api_service.cc b/chrome/browser/drive/drive_api_service.cc
index e2f42be..970285a 100644
--- a/chrome/browser/drive/drive_api_service.cc
+++ b/chrome/browser/drive/drive_api_service.cc
@@ -558,7 +558,7 @@ CancelCallback DriveAPIService::InitiateUploadNewFile(
int64 content_length,
const std::string& parent_resource_id,
const std::string& title,
- const InitiateUploadNewFileOptions& options,
+ const UploadNewFileOptions& options,
const InitiateUploadCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
@@ -580,7 +580,7 @@ CancelCallback DriveAPIService::InitiateUploadExistingFile(
const std::string& content_type,
int64 content_length,
const std::string& resource_id,
- const InitiateUploadExistingFileOptions& options,
+ const UploadExistingFileOptions& options,
const InitiateUploadCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
@@ -639,6 +639,37 @@ CancelCallback DriveAPIService::GetUploadStatus(
callback));
}
+CancelCallback DriveAPIService::MultipartUploadNewFile(
+ const std::string& content_type,
+ int64 content_length,
+ const std::string& parent_resource_id,
+ const std::string& title,
+ const base::FilePath& local_file_path,
+ const UploadNewFileOptions& options,
+ const FileResourceCallback& callback,
+ const google_apis::ProgressCallback& progress_callback) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK(!callback.is_null());
+
+ NOTIMPLEMENTED();
+ return CancelCallback();
+}
+
+CancelCallback DriveAPIService::MultipartUploadExistingFile(
+ const std::string& content_type,
+ int64 content_length,
+ const std::string& resource_id,
+ const base::FilePath& local_file_path,
+ const UploadExistingFileOptions& options,
+ const FileResourceCallback& callback,
+ const google_apis::ProgressCallback& progress_callback) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK(!callback.is_null());
+
+ NOTIMPLEMENTED();
+ return CancelCallback();
+}
+
CancelCallback DriveAPIService::AuthorizeApp(
const std::string& resource_id,
const std::string& app_id,
diff --git a/chrome/browser/drive/drive_api_service.h b/chrome/browser/drive/drive_api_service.h
index 569d89a..782dd4a 100644
--- a/chrome/browser/drive/drive_api_service.h
+++ b/chrome/browser/drive/drive_api_service.h
@@ -149,13 +149,13 @@ class DriveAPIService : public DriveServiceInterface,
int64 content_length,
const std::string& parent_resource_id,
const std::string& title,
- const InitiateUploadNewFileOptions& options,
+ const UploadNewFileOptions& options,
const google_apis::InitiateUploadCallback& callback) override;
google_apis::CancelCallback InitiateUploadExistingFile(
const std::string& content_type,
int64 content_length,
const std::string& resource_id,
- const InitiateUploadExistingFileOptions& options,
+ const UploadExistingFileOptions& options,
const google_apis::InitiateUploadCallback& callback) override;
google_apis::CancelCallback ResumeUpload(
const GURL& upload_url,
@@ -170,6 +170,23 @@ class DriveAPIService : public DriveServiceInterface,
const GURL& upload_url,
int64 content_length,
const google_apis::drive::UploadRangeCallback& callback) override;
+ google_apis::CancelCallback MultipartUploadNewFile(
+ const std::string& content_type,
+ int64 content_length,
+ const std::string& parent_resource_id,
+ const std::string& title,
+ const base::FilePath& local_file_path,
+ const UploadNewFileOptions& options,
+ const google_apis::FileResourceCallback& callback,
+ const google_apis::ProgressCallback& progress_callback) override;
+ google_apis::CancelCallback MultipartUploadExistingFile(
+ const std::string& content_type,
+ int64 content_length,
+ const std::string& resource_id,
+ const base::FilePath& local_file_path,
+ const UploadExistingFileOptions& options,
+ const google_apis::FileResourceCallback& callback,
+ const google_apis::ProgressCallback& progress_callback) override;
google_apis::CancelCallback AuthorizeApp(
const std::string& resource_id,
const std::string& app_id,
diff --git a/chrome/browser/drive/drive_service_interface.cc b/chrome/browser/drive/drive_service_interface.cc
index 0823ebb..94a8dfd 100644
--- a/chrome/browser/drive/drive_service_interface.cc
+++ b/chrome/browser/drive/drive_service_interface.cc
@@ -12,20 +12,16 @@ DriveServiceInterface::AddNewDirectoryOptions::AddNewDirectoryOptions() {
DriveServiceInterface::AddNewDirectoryOptions::~AddNewDirectoryOptions() {
}
-DriveServiceInterface::InitiateUploadNewFileOptions::
- InitiateUploadNewFileOptions() {
+DriveServiceInterface::UploadNewFileOptions::UploadNewFileOptions() {
}
-DriveServiceInterface::InitiateUploadNewFileOptions::
- ~InitiateUploadNewFileOptions() {
+DriveServiceInterface::UploadNewFileOptions::~UploadNewFileOptions() {
}
-DriveServiceInterface::InitiateUploadExistingFileOptions::
- InitiateUploadExistingFileOptions() {
+DriveServiceInterface::UploadExistingFileOptions::UploadExistingFileOptions() {
}
-DriveServiceInterface::InitiateUploadExistingFileOptions::
- ~InitiateUploadExistingFileOptions() {
+DriveServiceInterface::UploadExistingFileOptions::~UploadExistingFileOptions() {
}
} // namespace drive
diff --git a/chrome/browser/drive/drive_service_interface.h b/chrome/browser/drive/drive_service_interface.h
index 7ef0151..016a99ac 100644
--- a/chrome/browser/drive/drive_service_interface.h
+++ b/chrome/browser/drive/drive_service_interface.h
@@ -53,10 +53,11 @@ class DriveServiceInterface {
base::Time last_viewed_by_me_date;
};
- // Optional parameters for InitiateUploadNewFile().
- struct InitiateUploadNewFileOptions {
- InitiateUploadNewFileOptions();
- ~InitiateUploadNewFileOptions();
+ // Optional parameters for InitiateUploadNewFile() and
+ // MultipartUploadNewFile().
+ struct UploadNewFileOptions {
+ UploadNewFileOptions();
+ ~UploadNewFileOptions();
// modified_date of the file.
// Pass the null Time if you are not interested in setting this property.
@@ -67,10 +68,11 @@ class DriveServiceInterface {
base::Time last_viewed_by_me_date;
};
- // Optional parameters for InitiateUploadExistingFile().
- struct InitiateUploadExistingFileOptions {
- InitiateUploadExistingFileOptions();
- ~InitiateUploadExistingFileOptions();
+ // Optional parameters for InitiateUploadExistingFile() and
+ // MultipartUploadExistingFile().
+ struct UploadExistingFileOptions {
+ UploadExistingFileOptions();
+ ~UploadExistingFileOptions();
// Expected ETag of the file. UPLOAD_ERROR_CONFLICT error is generated when
// matching fails.
@@ -349,7 +351,7 @@ class DriveServiceInterface {
int64 content_length,
const std::string& parent_resource_id,
const std::string& title,
- const InitiateUploadNewFileOptions& options,
+ const UploadNewFileOptions& options,
const google_apis::InitiateUploadCallback& callback) = 0;
// Initiates uploading of an existing document/file.
@@ -360,7 +362,7 @@ class DriveServiceInterface {
const std::string& content_type,
int64 content_length,
const std::string& resource_id,
- const InitiateUploadExistingFileOptions& options,
+ const UploadExistingFileOptions& options,
const google_apis::InitiateUploadCallback& callback) = 0;
// Resumes uploading of a document/file on the calling thread.
@@ -384,6 +386,33 @@ class DriveServiceInterface {
int64 content_length,
const google_apis::drive::UploadRangeCallback& callback) = 0;
+ // Uploads a file by a single request with multipart body. It's more efficient
+ // for small files than using |InitiateUploadNewFile| and |ResumeUpload|.
+ // |content_type| and |content_length| should be the ones of the file to be
+ // uploaded. |callback| must not be null. |progress_callback| may be null.
+ virtual google_apis::CancelCallback MultipartUploadNewFile(
+ const std::string& content_type,
+ int64 content_length,
+ const std::string& parent_resource_id,
+ const std::string& title,
+ const base::FilePath& local_file_path,
+ const UploadNewFileOptions& options,
+ const google_apis::FileResourceCallback& callback,
+ const google_apis::ProgressCallback& progress_callback) = 0;
+
+ // Uploads a file by a single request with multipart body. It's more efficient
+ // for small files than using |InitiateUploadExistingFile| and |ResumeUpload|.
+ // |content_type| and |content_length| should be the ones of the file to be
+ // uploaded. |callback| must not be null. |progress_callback| may be null.
+ virtual google_apis::CancelCallback MultipartUploadExistingFile(
+ const std::string& content_type,
+ int64 content_length,
+ const std::string& resource_id,
+ const base::FilePath& local_file_path,
+ const UploadExistingFileOptions& options,
+ const google_apis::FileResourceCallback& callback,
+ const google_apis::ProgressCallback& progress_callback) = 0;
+
// Authorizes a Drive app with the id |app_id| to open the given file.
// Upon completion, invokes |callback| with the link to open the file with
// the provided app. |callback| must not be null.
diff --git a/chrome/browser/drive/drive_uploader.h b/chrome/browser/drive/drive_uploader.h
index 857b65b..ad64394 100644
--- a/chrome/browser/drive/drive_uploader.h
+++ b/chrome/browser/drive/drive_uploader.h
@@ -40,9 +40,8 @@ typedef base::Callback<void(
class DriveUploaderInterface {
public:
- typedef DriveServiceInterface::InitiateUploadNewFileOptions
- UploadNewFileOptions;
- typedef DriveServiceInterface::InitiateUploadExistingFileOptions
+ typedef DriveServiceInterface::UploadNewFileOptions UploadNewFileOptions;
+ typedef DriveServiceInterface::UploadExistingFileOptions
UploadExistingFileOptions;
virtual ~DriveUploaderInterface() {}
diff --git a/chrome/browser/drive/drive_uploader_unittest.cc b/chrome/browser/drive/drive_uploader_unittest.cc
index 8b160d6..e46a62f 100644
--- a/chrome/browser/drive/drive_uploader_unittest.cc
+++ b/chrome/browser/drive/drive_uploader_unittest.cc
@@ -80,7 +80,7 @@ class MockDriveServiceWithUploadExpectation : public DummyDriveService {
int64 content_length,
const std::string& parent_resource_id,
const std::string& title,
- const InitiateUploadNewFileOptions& options,
+ const UploadNewFileOptions& options,
const InitiateUploadCallback& callback) override {
EXPECT_EQ(kTestDocumentTitle, title);
EXPECT_EQ(kTestMimeType, content_type);
@@ -98,7 +98,7 @@ class MockDriveServiceWithUploadExpectation : public DummyDriveService {
const std::string& content_type,
int64 content_length,
const std::string& resource_id,
- const InitiateUploadExistingFileOptions& options,
+ const UploadExistingFileOptions& options,
const InitiateUploadCallback& callback) override {
EXPECT_EQ(kTestMimeType, content_type);
EXPECT_EQ(expected_content_length_, content_length);
@@ -211,7 +211,7 @@ class MockDriveServiceNoConnectionAtInitiate : public DummyDriveService {
int64 content_length,
const std::string& parent_resource_id,
const std::string& title,
- const InitiateUploadNewFileOptions& options,
+ const UploadNewFileOptions& options,
const InitiateUploadCallback& callback) override {
base::MessageLoop::current()->PostTask(FROM_HERE,
base::Bind(callback, GDATA_NO_CONNECTION, GURL()));
@@ -222,7 +222,7 @@ class MockDriveServiceNoConnectionAtInitiate : public DummyDriveService {
const std::string& content_type,
int64 content_length,
const std::string& resource_id,
- const InitiateUploadExistingFileOptions& options,
+ const UploadExistingFileOptions& options,
const InitiateUploadCallback& callback) override {
base::MessageLoop::current()->PostTask(FROM_HERE,
base::Bind(callback, GDATA_NO_CONNECTION, GURL()));
@@ -252,7 +252,7 @@ class MockDriveServiceNoConnectionAtResume : public DummyDriveService {
int64 content_length,
const std::string& parent_resource_id,
const std::string& title,
- const InitiateUploadNewFileOptions& options,
+ const UploadNewFileOptions& options,
const InitiateUploadCallback& callback) override {
base::MessageLoop::current()->PostTask(FROM_HERE,
base::Bind(callback, HTTP_SUCCESS, GURL(kTestUploadNewFileURL)));
@@ -263,7 +263,7 @@ class MockDriveServiceNoConnectionAtResume : public DummyDriveService {
const std::string& content_type,
int64 content_length,
const std::string& resource_id,
- const InitiateUploadExistingFileOptions& options,
+ const UploadExistingFileOptions& options,
const InitiateUploadCallback& callback) override {
base::MessageLoop::current()->PostTask(FROM_HERE,
base::Bind(callback, HTTP_SUCCESS, GURL(kTestUploadExistingFileURL)));
diff --git a/chrome/browser/drive/dummy_drive_service.cc b/chrome/browser/drive/dummy_drive_service.cc
index ccfbebb..7207ac6 100644
--- a/chrome/browser/drive/dummy_drive_service.cc
+++ b/chrome/browser/drive/dummy_drive_service.cc
@@ -149,15 +149,19 @@ CancelCallback DummyDriveService::InitiateUploadNewFile(
int64 content_length,
const std::string& parent_resource_id,
const std::string& title,
- const InitiateUploadNewFileOptions& options,
- const InitiateUploadCallback& callback) { return CancelCallback(); }
+ const UploadNewFileOptions& options,
+ const InitiateUploadCallback& callback) {
+ return CancelCallback();
+}
CancelCallback DummyDriveService::InitiateUploadExistingFile(
const std::string& content_type,
int64 content_length,
const std::string& resource_id,
- const InitiateUploadExistingFileOptions& options,
- const InitiateUploadCallback& callback) { return CancelCallback(); }
+ const UploadExistingFileOptions& options,
+ const InitiateUploadCallback& callback) {
+ return CancelCallback();
+}
CancelCallback DummyDriveService::ResumeUpload(
const GURL& upload_url,
@@ -174,6 +178,29 @@ CancelCallback DummyDriveService::GetUploadStatus(
int64 content_length,
const UploadRangeCallback& callback) { return CancelCallback(); }
+CancelCallback DummyDriveService::MultipartUploadNewFile(
+ const std::string& content_type,
+ int64 content_length,
+ const std::string& parent_resource_id,
+ const std::string& title,
+ const base::FilePath& local_file_path,
+ const UploadNewFileOptions& options,
+ const FileResourceCallback& callback,
+ const ProgressCallback& progress_callback) {
+ return CancelCallback();
+}
+
+CancelCallback DummyDriveService::MultipartUploadExistingFile(
+ const std::string& content_type,
+ int64 content_length,
+ const std::string& resource_id,
+ const base::FilePath& local_file_path,
+ const UploadExistingFileOptions& options,
+ const FileResourceCallback& callback,
+ const ProgressCallback& progress_callback) {
+ return CancelCallback();
+}
+
CancelCallback DummyDriveService::AuthorizeApp(
const std::string& resource_id,
const std::string& app_id,
diff --git a/chrome/browser/drive/dummy_drive_service.h b/chrome/browser/drive/dummy_drive_service.h
index a97e102..c2b4aae 100644
--- a/chrome/browser/drive/dummy_drive_service.h
+++ b/chrome/browser/drive/dummy_drive_service.h
@@ -105,13 +105,13 @@ class DummyDriveService : public DriveServiceInterface {
int64 content_length,
const std::string& parent_resource_id,
const std::string& title,
- const InitiateUploadNewFileOptions& options,
+ const UploadNewFileOptions& options,
const google_apis::InitiateUploadCallback& callback) override;
google_apis::CancelCallback InitiateUploadExistingFile(
const std::string& content_type,
int64 content_length,
const std::string& resource_id,
- const InitiateUploadExistingFileOptions& options,
+ const UploadExistingFileOptions& options,
const google_apis::InitiateUploadCallback& callback) override;
google_apis::CancelCallback ResumeUpload(
const GURL& upload_url,
@@ -126,6 +126,23 @@ class DummyDriveService : public DriveServiceInterface {
const GURL& upload_url,
int64 content_length,
const google_apis::drive::UploadRangeCallback& callback) override;
+ google_apis::CancelCallback MultipartUploadNewFile(
+ const std::string& content_type,
+ int64 content_length,
+ const std::string& parent_resource_id,
+ const std::string& title,
+ const base::FilePath& local_file_path,
+ const UploadNewFileOptions& options,
+ const google_apis::FileResourceCallback& callback,
+ const google_apis::ProgressCallback& progress_callback) override;
+ google_apis::CancelCallback MultipartUploadExistingFile(
+ const std::string& content_type,
+ int64 content_length,
+ const std::string& resource_id,
+ const base::FilePath& local_file_path,
+ const UploadExistingFileOptions& options,
+ const google_apis::FileResourceCallback& callback,
+ const google_apis::ProgressCallback& progress_callback) override;
google_apis::CancelCallback AuthorizeApp(
const std::string& resource_id,
const std::string& app_id,
diff --git a/chrome/browser/drive/fake_drive_service.cc b/chrome/browser/drive/fake_drive_service.cc
index d13c1a8..29c9925 100644
--- a/chrome/browser/drive/fake_drive_service.cc
+++ b/chrome/browser/drive/fake_drive_service.cc
@@ -1017,7 +1017,7 @@ CancelCallback FakeDriveService::InitiateUploadNewFile(
int64 content_length,
const std::string& parent_resource_id,
const std::string& title,
- const InitiateUploadNewFileOptions& options,
+ const UploadNewFileOptions& options,
const InitiateUploadCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
@@ -1055,7 +1055,7 @@ CancelCallback FakeDriveService::InitiateUploadExistingFile(
const std::string& content_type,
int64 content_length,
const std::string& resource_id,
- const InitiateUploadExistingFileOptions& options,
+ const UploadExistingFileOptions& options,
const InitiateUploadCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
@@ -1230,6 +1230,37 @@ CancelCallback FakeDriveService::ResumeUpload(
return CancelCallback();
}
+CancelCallback FakeDriveService::MultipartUploadNewFile(
+ const std::string& content_type,
+ int64 content_length,
+ const std::string& parent_resource_id,
+ const std::string& title,
+ const base::FilePath& local_file_path,
+ const UploadNewFileOptions& options,
+ const FileResourceCallback& callback,
+ const google_apis::ProgressCallback& progress_callback) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK(!callback.is_null());
+
+ NOTIMPLEMENTED();
+ return CancelCallback();
+}
+
+CancelCallback FakeDriveService::MultipartUploadExistingFile(
+ const std::string& content_type,
+ int64 content_length,
+ const std::string& resource_id,
+ const base::FilePath& local_file_path,
+ const UploadExistingFileOptions& options,
+ const FileResourceCallback& callback,
+ const google_apis::ProgressCallback& progress_callback) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK(!callback.is_null());
+
+ NOTIMPLEMENTED();
+ return CancelCallback();
+}
+
CancelCallback FakeDriveService::AuthorizeApp(
const std::string& resource_id,
const std::string& app_id,
diff --git a/chrome/browser/drive/fake_drive_service.h b/chrome/browser/drive/fake_drive_service.h
index e86fb95..e3e4025 100644
--- a/chrome/browser/drive/fake_drive_service.h
+++ b/chrome/browser/drive/fake_drive_service.h
@@ -217,13 +217,13 @@ class FakeDriveService : public DriveServiceInterface {
int64 content_length,
const std::string& parent_resource_id,
const std::string& title,
- const InitiateUploadNewFileOptions& options,
+ const UploadNewFileOptions& options,
const google_apis::InitiateUploadCallback& callback) override;
google_apis::CancelCallback InitiateUploadExistingFile(
const std::string& content_type,
int64 content_length,
const std::string& resource_id,
- const InitiateUploadExistingFileOptions& options,
+ const UploadExistingFileOptions& options,
const google_apis::InitiateUploadCallback& callback) override;
google_apis::CancelCallback ResumeUpload(
const GURL& upload_url,
@@ -238,6 +238,23 @@ class FakeDriveService : public DriveServiceInterface {
const GURL& upload_url,
int64 content_length,
const google_apis::drive::UploadRangeCallback& callback) override;
+ google_apis::CancelCallback MultipartUploadNewFile(
+ const std::string& content_type,
+ int64 content_length,
+ const std::string& parent_resource_id,
+ const std::string& title,
+ const base::FilePath& local_file_path,
+ const UploadNewFileOptions& options,
+ const google_apis::FileResourceCallback& callback,
+ const google_apis::ProgressCallback& progress_callback) override;
+ google_apis::CancelCallback MultipartUploadExistingFile(
+ const std::string& content_type,
+ int64 content_length,
+ const std::string& resource_id,
+ const base::FilePath& local_file_path,
+ const UploadExistingFileOptions& options,
+ const google_apis::FileResourceCallback& callback,
+ const google_apis::ProgressCallback& progress_callback) override;
google_apis::CancelCallback AuthorizeApp(
const std::string& resource_id,
const std::string& app_id,
diff --git a/chrome/browser/drive/fake_drive_service_unittest.cc b/chrome/browser/drive/fake_drive_service_unittest.cc
index d440f9d..d1f845f 100644
--- a/chrome/browser/drive/fake_drive_service_unittest.cc
+++ b/chrome/browser/drive/fake_drive_service_unittest.cc
@@ -1632,11 +1632,8 @@ TEST_F(FakeDriveServiceTest, InitiateUploadNewFile_Offline) {
GDataErrorCode error = GDATA_OTHER_ERROR;
GURL upload_location;
fake_service_.InitiateUploadNewFile(
- "test/foo",
- 13,
- "1_folder_resource_id",
- "new file.foo",
- FakeDriveService::InitiateUploadNewFileOptions(),
+ "test/foo", 13, "1_folder_resource_id", "new file.foo",
+ FakeDriveService::UploadNewFileOptions(),
test_util::CreateCopyResultCallback(&error, &upload_location));
base::RunLoop().RunUntilIdle();
@@ -1650,11 +1647,8 @@ TEST_F(FakeDriveServiceTest, InitiateUploadNewFile_NotFound) {
GDataErrorCode error = GDATA_OTHER_ERROR;
GURL upload_location;
fake_service_.InitiateUploadNewFile(
- "test/foo",
- 13,
- "non_existent",
- "new file.foo",
- FakeDriveService::InitiateUploadNewFileOptions(),
+ "test/foo", 13, "non_existent", "new file.foo",
+ FakeDriveService::UploadNewFileOptions(),
test_util::CreateCopyResultCallback(&error, &upload_location));
base::RunLoop().RunUntilIdle();
@@ -1668,11 +1662,8 @@ TEST_F(FakeDriveServiceTest, InitiateUploadNewFile) {
GDataErrorCode error = GDATA_OTHER_ERROR;
GURL upload_location;
fake_service_.InitiateUploadNewFile(
- "test/foo",
- 13,
- "1_folder_resource_id",
- "new file.foo",
- FakeDriveService::InitiateUploadNewFileOptions(),
+ "test/foo", 13, "1_folder_resource_id", "new file.foo",
+ FakeDriveService::UploadNewFileOptions(),
test_util::CreateCopyResultCallback(&error, &upload_location));
base::RunLoop().RunUntilIdle();
@@ -1689,10 +1680,8 @@ TEST_F(FakeDriveServiceTest, InitiateUploadExistingFile_Offline) {
GDataErrorCode error = GDATA_OTHER_ERROR;
GURL upload_location;
fake_service_.InitiateUploadExistingFile(
- "test/foo",
- 13,
- "2_file_resource_id",
- FakeDriveService::InitiateUploadExistingFileOptions(),
+ "test/foo", 13, "2_file_resource_id",
+ FakeDriveService::UploadExistingFileOptions(),
test_util::CreateCopyResultCallback(&error, &upload_location));
base::RunLoop().RunUntilIdle();
@@ -1709,10 +1698,8 @@ TEST_F(FakeDriveServiceTest, InitiateUploadExistingFile_Forbidden) {
GDataErrorCode error = GDATA_OTHER_ERROR;
GURL upload_location;
fake_service_.InitiateUploadExistingFile(
- "test/foo",
- 13,
- "2_file_resource_id",
- FakeDriveService::InitiateUploadExistingFileOptions(),
+ "test/foo", 13, "2_file_resource_id",
+ FakeDriveService::UploadExistingFileOptions(),
test_util::CreateCopyResultCallback(&error, &upload_location));
base::RunLoop().RunUntilIdle();
@@ -1726,10 +1713,8 @@ TEST_F(FakeDriveServiceTest, InitiateUploadExistingFile_NotFound) {
GDataErrorCode error = GDATA_OTHER_ERROR;
GURL upload_location;
fake_service_.InitiateUploadExistingFile(
- "test/foo",
- 13,
- "non_existent",
- FakeDriveService::InitiateUploadExistingFileOptions(),
+ "test/foo", 13, "non_existent",
+ FakeDriveService::UploadExistingFileOptions(),
test_util::CreateCopyResultCallback(&error, &upload_location));
base::RunLoop().RunUntilIdle();
@@ -1740,7 +1725,7 @@ TEST_F(FakeDriveServiceTest, InitiateUploadExistingFile_NotFound) {
TEST_F(FakeDriveServiceTest, InitiateUploadExistingFile_WrongETag) {
ASSERT_TRUE(test_util::SetUpTestEntries(&fake_service_));
- FakeDriveService::InitiateUploadExistingFileOptions options;
+ FakeDriveService::UploadExistingFileOptions options;
options.etag = "invalid_etag";
GDataErrorCode error = GDATA_OTHER_ERROR;
@@ -1763,7 +1748,7 @@ TEST_F(FakeDriveServiceTest, InitiateUpload_ExistingFile) {
scoped_ptr<FileResource> entry = FindEntry("2_file_resource_id");
ASSERT_TRUE(entry);
- FakeDriveService::InitiateUploadExistingFileOptions options;
+ FakeDriveService::UploadExistingFileOptions options;
options.etag = entry->etag();
GDataErrorCode error = GDATA_OTHER_ERROR;
@@ -1786,11 +1771,8 @@ TEST_F(FakeDriveServiceTest, ResumeUpload_Offline) {
GDataErrorCode error = GDATA_OTHER_ERROR;
GURL upload_location;
fake_service_.InitiateUploadNewFile(
- "test/foo",
- 15,
- "1_folder_resource_id",
- "new file.foo",
- FakeDriveService::InitiateUploadNewFileOptions(),
+ "test/foo", 15, "1_folder_resource_id", "new file.foo",
+ FakeDriveService::UploadNewFileOptions(),
test_util::CreateCopyResultCallback(&error, &upload_location));
base::RunLoop().RunUntilIdle();
@@ -1821,11 +1803,8 @@ TEST_F(FakeDriveServiceTest, ResumeUpload_NotFound) {
GDataErrorCode error = GDATA_OTHER_ERROR;
GURL upload_location;
fake_service_.InitiateUploadNewFile(
- "test/foo",
- 15,
- "1_folder_resource_id",
- "new file.foo",
- FakeDriveService::InitiateUploadNewFileOptions(),
+ "test/foo", 15, "1_folder_resource_id", "new file.foo",
+ FakeDriveService::UploadNewFileOptions(),
test_util::CreateCopyResultCallback(&error, &upload_location));
base::RunLoop().RunUntilIdle();
@@ -1858,7 +1837,7 @@ TEST_F(FakeDriveServiceTest, ResumeUpload_ExistingFile) {
scoped_ptr<FileResource> entry = FindEntry("2_file_resource_id");
ASSERT_TRUE(entry);
- FakeDriveService::InitiateUploadExistingFileOptions options;
+ FakeDriveService::UploadExistingFileOptions options;
options.etag = entry->etag();
GDataErrorCode error = GDATA_OTHER_ERROR;
@@ -1928,11 +1907,8 @@ TEST_F(FakeDriveServiceTest, ResumeUpload_NewFile) {
GDataErrorCode error = GDATA_OTHER_ERROR;
GURL upload_location;
fake_service_.InitiateUploadNewFile(
- "test/foo",
- contents.size(),
- "1_folder_resource_id",
- "new file.foo",
- FakeDriveService::InitiateUploadNewFileOptions(),
+ "test/foo", contents.size(), "1_folder_resource_id", "new file.foo",
+ FakeDriveService::UploadNewFileOptions(),
test_util::CreateCopyResultCallback(&error, &upload_location));
base::RunLoop().RunUntilIdle();