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

Unified Diff: google_apis/drive/drive_api_url_generator_unittest.cc

Issue 2894513003: Fetch files shared in Team Drives by specifying allTeamDrives corpora. (Closed)
Patch Set: Make comment style consistent with existing one Created 3 years, 6 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 | « google_apis/drive/drive_api_url_generator.cc ('k') | google_apis/drive/files_list_request_runner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/drive/drive_api_url_generator_unittest.cc
diff --git a/google_apis/drive/drive_api_url_generator_unittest.cc b/google_apis/drive/drive_api_url_generator_unittest.cc
index 43bc4524b7d1d840cb30127e1c8afae6af33d30f..70be39b6b50e965b1d8ab9c8d6bc6f8dbf1e03b2 100644
--- a/google_apis/drive/drive_api_url_generator_unittest.cc
+++ b/google_apis/drive/drive_api_url_generator_unittest.cc
@@ -204,24 +204,39 @@ TEST_F(DriveApiUrlGeneratorTest, GetFilesListUrl) {
const std::string kV2FilesUrlPrefix =
"https://www.example.com/drive/v2/files";
const std::string kV2FilesUrlPrefixWithTeamDrives =
- "https://www.example.com/drive/v2/files?"
- "supportsTeamDrives=true&includeTeamDriveItems=true";
+ "https://www.example.com/drive/v2/files?supportsTeamDrives=true&"
+ "includeTeamDriveItems=true&corpora=default%2CallTeamDrives";
for (size_t i = 0; i < arraysize(kTestPatterns); ++i) {
EXPECT_EQ(kV2FilesUrlPrefix +
(kTestPatterns[i].expected_query.empty() ? "" : "?") +
kTestPatterns[i].expected_query,
- url_generator_.GetFilesListUrl(kTestPatterns[i].max_results,
- kTestPatterns[i].page_token,
- kTestPatterns[i].q).spec());
+ url_generator_
+ .GetFilesListUrl(kTestPatterns[i].max_results,
+ kTestPatterns[i].page_token,
+ FilesListCorpora::DEFAULT, std::string(),
+ kTestPatterns[i].q)
+ .spec());
EXPECT_EQ(kV2FilesUrlPrefixWithTeamDrives +
(kTestPatterns[i].expected_query.empty() ? "" : "&") +
kTestPatterns[i].expected_query,
- team_drives_url_generator_.GetFilesListUrl(
- kTestPatterns[i].max_results,
- kTestPatterns[i].page_token,
- kTestPatterns[i].q).spec());
+ team_drives_url_generator_
+ .GetFilesListUrl(kTestPatterns[i].max_results,
+ kTestPatterns[i].page_token,
+ FilesListCorpora::ALL_TEAM_DRIVES,
+ std::string(), kTestPatterns[i].q)
+ .spec());
}
+
+ EXPECT_EQ(
+ "https://www.example.com/drive/v2/files?supportsTeamDrives=true&"
+ "includeTeamDriveItems=true&corpora=teamDrive&"
+ "teamDriveId=TheTeamDriveId&q=query",
+ team_drives_url_generator_
+ .GetFilesListUrl(100, std::string() /* page_token */,
+ FilesListCorpora::TEAM_DRIVE, "TheTeamDriveId",
+ "query")
+ .spec());
}
TEST_F(DriveApiUrlGeneratorTest, GetFilesDeleteUrl) {
« no previous file with comments | « google_apis/drive/drive_api_url_generator.cc ('k') | google_apis/drive/files_list_request_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698