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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 url_generator_.GetFilesTrashUrl("0Bz0bd074").spec()); | 247 url_generator_.GetFilesTrashUrl("0Bz0bd074").spec()); |
248 EXPECT_EQ("https://www.example.com/drive/v2/files/file%3Afile_id/trash", | 248 EXPECT_EQ("https://www.example.com/drive/v2/files/file%3Afile_id/trash", |
249 url_generator_.GetFilesTrashUrl("file:file_id").spec()); | 249 url_generator_.GetFilesTrashUrl("file:file_id").spec()); |
250 | 250 |
251 EXPECT_EQ( | 251 EXPECT_EQ( |
252 "https://www.example.com/drive/v2/files/0ADK06pfg/trash?" | 252 "https://www.example.com/drive/v2/files/0ADK06pfg/trash?" |
253 "supportsTeamDrives=true", | 253 "supportsTeamDrives=true", |
254 team_drives_url_generator_.GetFilesTrashUrl("0ADK06pfg").spec()); | 254 team_drives_url_generator_.GetFilesTrashUrl("0ADK06pfg").spec()); |
255 } | 255 } |
256 | 256 |
| 257 TEST_F(DriveApiUrlGeneratorTest, GetChangesGetStartPageTokenUrl) { |
| 258 EXPECT_EQ( |
| 259 "https://www.example.com/drive/v2/changes/startPageToken?" |
| 260 "supportsTeamDrives=true", |
| 261 team_drives_url_generator_ |
| 262 .GetChangesGetStartPageTokenUrl("" /* team_drive_id */) |
| 263 .spec()); |
| 264 EXPECT_EQ( |
| 265 "https://www.example.com/drive/v2/changes/startPageToken?" |
| 266 "supportsTeamDrives=true&teamDriveId=TheTeamDriveId", |
| 267 team_drives_url_generator_ |
| 268 .GetChangesGetStartPageTokenUrl("TheTeamDriveId") |
| 269 .spec()); |
| 270 } |
| 271 |
257 TEST_F(DriveApiUrlGeneratorTest, GetChangesListUrl) { | 272 TEST_F(DriveApiUrlGeneratorTest, GetChangesListUrl) { |
258 struct TestPattern { | 273 struct TestPattern { |
259 bool include_deleted; | 274 bool include_deleted; |
260 int max_results; | 275 int max_results; |
261 const std::string page_token; | 276 const std::string page_token; |
262 int64_t start_change_id; | 277 int64_t start_change_id; |
263 const std::string expected_query; | 278 const std::string expected_query; |
264 }; | 279 }; |
265 const TestPattern kTestPatterns[] = { | 280 const TestPattern kTestPatterns[] = { |
266 { true, 100, "", 0, "" }, | 281 { true, 100, "", 0, "" }, |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 team_drives_url_generator_.GetTeamDriveListUrl(10, "").spec()); | 527 team_drives_url_generator_.GetTeamDriveListUrl(10, "").spec()); |
513 EXPECT_EQ("https://www.example.com/drive/v2/teamdrives?maxResults=100", | 528 EXPECT_EQ("https://www.example.com/drive/v2/teamdrives?maxResults=100", |
514 team_drives_url_generator_.GetTeamDriveListUrl(100, "").spec()); | 529 team_drives_url_generator_.GetTeamDriveListUrl(100, "").spec()); |
515 EXPECT_EQ( | 530 EXPECT_EQ( |
516 "https://www.example.com/drive/v2/" | 531 "https://www.example.com/drive/v2/" |
517 "teamdrives?maxResults=100&pageToken=theToken", | 532 "teamdrives?maxResults=100&pageToken=theToken", |
518 team_drives_url_generator_.GetTeamDriveListUrl(100, "theToken").spec()); | 533 team_drives_url_generator_.GetTeamDriveListUrl(100, "theToken").spec()); |
519 } | 534 } |
520 | 535 |
521 } // namespace google_apis | 536 } // namespace google_apis |
OLD | NEW |