diff options
author | hirono <hirono@chromium.org> | 2015-04-13 17:42:23 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-14 00:42:42 +0000 |
commit | 185e32eda8c8a70058558c84894ed1f69ae6c598 (patch) | |
tree | f68a8b200b8910a493af6b1ef66f3cd72909c73d /google_apis | |
parent | 1e38d46eb6b018a05aacaa7ced991d83e1dfc210 (diff) | |
download | chromium_src-185e32eda8c8a70058558c84894ed1f69ae6c598.zip chromium_src-185e32eda8c8a70058558c84894ed1f69ae6c598.tar.gz chromium_src-185e32eda8c8a70058558c84894ed1f69ae6c598.tar.bz2 |
Files.app: Add URL for batch uploading to URLGenerator.
BUG=451917
TEST=DriveApiUrlGeneratorTest.BatchUploadUrl
Review URL: https://codereview.chromium.org/1081033002
Cr-Commit-Position: refs/heads/master@{#324963}
Diffstat (limited to 'google_apis')
-rw-r--r-- | google_apis/drive/drive_api_url_generator.cc | 5 | ||||
-rw-r--r-- | google_apis/drive/drive_api_url_generator.h | 3 | ||||
-rw-r--r-- | google_apis/drive/drive_api_url_generator_unittest.cc | 6 |
3 files changed, 14 insertions, 0 deletions
diff --git a/google_apis/drive/drive_api_url_generator.cc b/google_apis/drive/drive_api_url_generator.cc index 285e754..f2d36fa 100644 --- a/google_apis/drive/drive_api_url_generator.cc +++ b/google_apis/drive/drive_api_url_generator.cc @@ -29,6 +29,7 @@ const char kDriveV2FileDeleteUrlFormat[] = "drive/v2/files/%s"; const char kDriveV2FileTrashUrlFormat[] = "drive/v2/files/%s/trash"; const char kDriveV2UploadNewFileUrl[] = "upload/drive/v2/files"; const char kDriveV2UploadExistingFileUrlPrefix[] = "upload/drive/v2/files/"; +const char kDriveV2BatchUploadUrl[] = "upload/drive"; const char kDriveV2PermissionsUrlFormat[] = "drive/v2/files/%s/permissions"; const char kDriveV2DownloadUrlFormat[] = "host/%s"; const char kDriveV2ThumbnailUrlFormat[] = "thumb/%s?width=%d&height=%d"; @@ -288,4 +289,8 @@ GURL DriveApiUrlGenerator::GetThumbnailUrl(const std::string& resource_id, net::EscapePath(resource_id).c_str(), width, height)); } +GURL DriveApiUrlGenerator::GetBatchUploadUrl() const { + return base_url_.Resolve(kDriveV2BatchUploadUrl); +} + } // namespace google_apis diff --git a/google_apis/drive/drive_api_url_generator.h b/google_apis/drive/drive_api_url_generator.h index ab623e3..dbdc6c7 100644 --- a/google_apis/drive/drive_api_url_generator.h +++ b/google_apis/drive/drive_api_url_generator.h @@ -112,6 +112,9 @@ class DriveApiUrlGenerator { int width, int height) const; + // Generates a URL for batch upload. + GURL GetBatchUploadUrl() const; + private: const GURL base_url_; const GURL base_download_url_; diff --git a/google_apis/drive/drive_api_url_generator_unittest.cc b/google_apis/drive/drive_api_url_generator_unittest.cc index 03e4c02..92e128e 100644 --- a/google_apis/drive/drive_api_url_generator_unittest.cc +++ b/google_apis/drive/drive_api_url_generator_unittest.cc @@ -363,4 +363,10 @@ TEST_F(DriveApiUrlGeneratorTest, GenerateThumbnailUrl) { url_generator_.GetThumbnailUrl("0ADK06pfg", 500, 500).spec()); } +TEST_F(DriveApiUrlGeneratorTest, BatchUploadUrl) { + EXPECT_EQ( + "https://www.example.com/upload/drive", + url_generator_.GetBatchUploadUrl().spec()); +} + } // namespace google_apis |