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

Side by Side Diff: google_apis/drive/drive_api_url_generator_unittest.cc

Issue 1301563003: Revert of Allow url::SchemeHostPort to hold non-file scheme without port (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
OLDNEW
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
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", url::SCHEME_WITHOUT_PORT); 65 url::AddStandardScheme("chrome-extension");
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
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
OLDNEW
« no previous file with comments | « extensions/test/extensions_unittests_main.cc ('k') | ios/chrome/test/ios_chrome_unit_test_suite.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698