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

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

Issue 12225101: Implement GetInitiateUpload{New,Existing}FileUrl on Drive API v2. (Closed) Base URL: http://git.chromium.org/chromium/src.git@b148632_replace_url_to_resource_id_2
Patch Set: Created 7 years, 10 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 | « chrome/browser/google_apis/drive_api_url_generator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/google_apis/drive_api_url_generator_unittest.cc
diff --git a/chrome/browser/google_apis/drive_api_url_generator_unittest.cc b/chrome/browser/google_apis/drive_api_url_generator_unittest.cc
index f28b3e030460510f3d8b517a3769351c88c438a4..bac3326e637fa97e63cb0be306798940868f02d1 100644
--- a/chrome/browser/google_apis/drive_api_url_generator_unittest.cc
+++ b/chrome/browser/google_apis/drive_api_url_generator_unittest.cc
@@ -176,4 +176,46 @@ TEST_F(DriveApiUrlGeneratorTest, GetFileTrashUrl) {
test_url_generator_.GetFileTrashUrl("file:file_id").spec());
}
+TEST_F(DriveApiUrlGeneratorTest, GetInitiateUploadNewFileUrl) {
+ EXPECT_EQ(
+ "https://www.googleapis.com/upload/drive/v2/files?uploadType=resumable",
+ url_generator_.GetInitiateUploadNewFileUrl().spec());
+
+ EXPECT_EQ(
+ "http://127.0.0.1:12345/upload/drive/v2/files?uploadType=resumable",
+ test_url_generator_.GetInitiateUploadNewFileUrl().spec());
+}
+
+TEST_F(DriveApiUrlGeneratorTest, GetInitiateUploadExistingFileUrl) {
+ // |resource_id| should be embedded into the url.
+ EXPECT_EQ(
+ "https://www.googleapis.com/upload/drive/v2/files/0ADK06pfg"
+ "?uploadType=resumable",
+ url_generator_.GetInitiateUploadExistingFileUrl("0ADK06pfg").spec());
+ EXPECT_EQ(
+ "https://www.googleapis.com/upload/drive/v2/files/0Bz0bd074"
+ "?uploadType=resumable",
+ url_generator_.GetInitiateUploadExistingFileUrl("0Bz0bd074").spec());
+ EXPECT_EQ(
+ "https://www.googleapis.com/upload/drive/v2/files/file%3Afile_id"
+ "?uploadType=resumable",
+ url_generator_.GetInitiateUploadExistingFileUrl("file:file_id").spec());
+
+ EXPECT_EQ(
+ "http://127.0.0.1:12345/upload/drive/v2/files/0ADK06pfg"
+ "?uploadType=resumable",
+ test_url_generator_.GetInitiateUploadExistingFileUrl(
+ "0ADK06pfg").spec());
+ EXPECT_EQ(
+ "http://127.0.0.1:12345/upload/drive/v2/files/0Bz0bd074"
+ "?uploadType=resumable",
+ test_url_generator_.GetInitiateUploadExistingFileUrl(
+ "0Bz0bd074").spec());
+ EXPECT_EQ(
+ "http://127.0.0.1:12345/upload/drive/v2/files/file%3Afile_id"
+ "?uploadType=resumable",
+ test_url_generator_.GetInitiateUploadExistingFileUrl(
+ "file:file_id").spec());
+}
+
} // namespace google_apis
« no previous file with comments | « chrome/browser/google_apis/drive_api_url_generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698