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 "google_apis/drive/test_util.h" | 7 #include "google_apis/drive/test_util.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "url/gurl.h" | 9 #include "url/gurl.h" |
10 #include "url/url_util.h" | 10 #include "url/url_util.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 EXPECT_EQ( | 55 EXPECT_EQ( |
56 "https://www.example.com/drive/v2/files/file%3Afile_id", | 56 "https://www.example.com/drive/v2/files/file%3Afile_id", |
57 url_generator_.GetFilesGetUrl("file:file_id", false, GURL()).spec()); | 57 url_generator_.GetFilesGetUrl("file:file_id", false, GURL()).spec()); |
58 | 58 |
59 // If |use_internal_endpoint| is true, the generated url should point to the | 59 // If |use_internal_endpoint| is true, the generated url should point to the |
60 // v2internal. | 60 // v2internal. |
61 EXPECT_EQ("https://www.example.com/drive/v2internal/files/0ADK06pfg", | 61 EXPECT_EQ("https://www.example.com/drive/v2internal/files/0ADK06pfg", |
62 url_generator_.GetFilesGetUrl("0ADK06pfg", true, GURL()).spec()); | 62 url_generator_.GetFilesGetUrl("0ADK06pfg", true, GURL()).spec()); |
63 | 63 |
64 // If |embed_origin| is not empty, it should be added as a query parameter. | 64 // If |embed_origin| is not empty, it should be added as a query parameter. |
65 url::AddStandardScheme("chrome-extension"); | 65 url::AddStandardScheme("chrome-extension", url::SCHEME_WITHOUT_PORT); |
66 EXPECT_EQ( | 66 EXPECT_EQ( |
67 "https://www.example.com/drive/v2/files/0ADK06pfg" | 67 "https://www.example.com/drive/v2/files/0ADK06pfg" |
68 "?embedOrigin=chrome-extension%3A%2F%2Ftest", | 68 "?embedOrigin=chrome-extension%3A%2F%2Ftest", |
69 url_generator_.GetFilesGetUrl("0ADK06pfg", false, | 69 url_generator_.GetFilesGetUrl("0ADK06pfg", false, |
70 GURL("chrome-extension://test")).spec()); | 70 GURL("chrome-extension://test")).spec()); |
71 EXPECT_EQ( | 71 EXPECT_EQ( |
72 "https://www.example.com/drive/v2internal/files/0ADK06pfg" | 72 "https://www.example.com/drive/v2internal/files/0ADK06pfg" |
73 "?embedOrigin=chrome-extension%3A%2F%2Ftest", | 73 "?embedOrigin=chrome-extension%3A%2F%2Ftest", |
74 url_generator_.GetFilesGetUrl("0ADK06pfg", true, | 74 url_generator_.GetFilesGetUrl("0ADK06pfg", true, |
75 GURL("chrome-extension://test")).spec()); | 75 GURL("chrome-extension://test")).spec()); |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 "0ADK06pfg?width=360&height=360&crop=true", | 367 "0ADK06pfg?width=360&height=360&crop=true", |
368 url_generator_.GetThumbnailUrl("0ADK06pfg", 360, 360, true).spec()); | 368 url_generator_.GetThumbnailUrl("0ADK06pfg", 360, 360, true).spec()); |
369 } | 369 } |
370 | 370 |
371 TEST_F(DriveApiUrlGeneratorTest, BatchUploadUrl) { | 371 TEST_F(DriveApiUrlGeneratorTest, BatchUploadUrl) { |
372 EXPECT_EQ("https://www.example.com/upload/drive", | 372 EXPECT_EQ("https://www.example.com/upload/drive", |
373 url_generator_.GetBatchUploadUrl().spec()); | 373 url_generator_.GetBatchUploadUrl().spec()); |
374 } | 374 } |
375 | 375 |
376 } // namespace google_apis | 376 } // namespace google_apis |
OLD | NEW |