| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "google_apis/drive/drive_api_url_generator.h" | 5 #include "google_apis/drive/drive_api_url_generator.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 { 100, "", "query", "q=query" }, | 197 { 100, "", "query", "q=query" }, |
| 198 { 150, "", "query", "maxResults=150&q=query" }, | 198 { 150, "", "query", "maxResults=150&q=query" }, |
| 199 { 10, "", "query", "maxResults=10&q=query" }, | 199 { 10, "", "query", "maxResults=10&q=query" }, |
| 200 { 100, "token", "query", "pageToken=token&q=query" }, | 200 { 100, "token", "query", "pageToken=token&q=query" }, |
| 201 { 150, "token", "query", "maxResults=150&pageToken=token&q=query" }, | 201 { 150, "token", "query", "maxResults=150&pageToken=token&q=query" }, |
| 202 { 10, "token", "query", "maxResults=10&pageToken=token&q=query" }, | 202 { 10, "token", "query", "maxResults=10&pageToken=token&q=query" }, |
| 203 }; | 203 }; |
| 204 const std::string kV2FilesUrlPrefix = | 204 const std::string kV2FilesUrlPrefix = |
| 205 "https://www.example.com/drive/v2/files"; | 205 "https://www.example.com/drive/v2/files"; |
| 206 const std::string kV2FilesUrlPrefixWithTeamDrives = | 206 const std::string kV2FilesUrlPrefixWithTeamDrives = |
| 207 "https://www.example.com/drive/v2/files?" | 207 "https://www.example.com/drive/v2/files?supportsTeamDrives=true&" |
| 208 "supportsTeamDrives=true&includeTeamDriveItems=true"; | 208 "includeTeamDriveItems=true&corpora=default%2CallTeamDrives"; |
| 209 | 209 |
| 210 for (size_t i = 0; i < arraysize(kTestPatterns); ++i) { | 210 for (size_t i = 0; i < arraysize(kTestPatterns); ++i) { |
| 211 EXPECT_EQ(kV2FilesUrlPrefix + | 211 EXPECT_EQ(kV2FilesUrlPrefix + |
| 212 (kTestPatterns[i].expected_query.empty() ? "" : "?") + | 212 (kTestPatterns[i].expected_query.empty() ? "" : "?") + |
| 213 kTestPatterns[i].expected_query, | 213 kTestPatterns[i].expected_query, |
| 214 url_generator_.GetFilesListUrl(kTestPatterns[i].max_results, | 214 url_generator_.GetFilesListUrl(kTestPatterns[i].max_results, |
| 215 kTestPatterns[i].page_token, | 215 kTestPatterns[i].page_token, |
| 216 kTestPatterns[i].q).spec()); | 216 kTestPatterns[i].q).spec()); |
| 217 EXPECT_EQ(kV2FilesUrlPrefixWithTeamDrives + | 217 EXPECT_EQ(kV2FilesUrlPrefixWithTeamDrives + |
| 218 (kTestPatterns[i].expected_query.empty() ? "" : "&") + | 218 (kTestPatterns[i].expected_query.empty() ? "" : "&") + |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 team_drives_url_generator_.GetTeamDriveListUrl(10, "").spec()); | 512 team_drives_url_generator_.GetTeamDriveListUrl(10, "").spec()); |
| 513 EXPECT_EQ("https://www.example.com/drive/v2/teamdrives?maxResults=100", | 513 EXPECT_EQ("https://www.example.com/drive/v2/teamdrives?maxResults=100", |
| 514 team_drives_url_generator_.GetTeamDriveListUrl(100, "").spec()); | 514 team_drives_url_generator_.GetTeamDriveListUrl(100, "").spec()); |
| 515 EXPECT_EQ( | 515 EXPECT_EQ( |
| 516 "https://www.example.com/drive/v2/" | 516 "https://www.example.com/drive/v2/" |
| 517 "teamdrives?maxResults=100&pageToken=theToken", | 517 "teamdrives?maxResults=100&pageToken=theToken", |
| 518 team_drives_url_generator_.GetTeamDriveListUrl(100, "theToken").spec()); | 518 team_drives_url_generator_.GetTeamDriveListUrl(100, "theToken").spec()); |
| 519 } | 519 } |
| 520 | 520 |
| 521 } // namespace google_apis | 521 } // namespace google_apis |
| OLD | NEW |