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

Side by Side Diff: net/base/net_util_unittest.cc

Issue 23835019: Support URL fragment resolution againt non-hierarchical schemes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: brettw2 Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | url/gurl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "net/base/net_util.h" 5 #include "net/base/net_util.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 3008 matching lines...) Expand 10 before | Expand all | Expand 10 after
3019 "http://google.com/sup?yo", 3019 "http://google.com/sup?yo",
3020 }, 3020 },
3021 { // Try an HTTPS URL -- strip both the reference and the username/password. 3021 { // Try an HTTPS URL -- strip both the reference and the username/password.
3022 "https://user:pass@google.com:80/sup?yo#X#X", 3022 "https://user:pass@google.com:80/sup?yo#X#X",
3023 "https://google.com:80/sup?yo", 3023 "https://google.com:80/sup?yo",
3024 }, 3024 },
3025 { // Try an FTP URL -- strip both the reference and the username/password. 3025 { // Try an FTP URL -- strip both the reference and the username/password.
3026 "ftp://user:pass@google.com:80/sup?yo#X#X", 3026 "ftp://user:pass@google.com:80/sup?yo#X#X",
3027 "ftp://google.com:80/sup?yo", 3027 "ftp://google.com:80/sup?yo",
3028 }, 3028 },
3029 { // Try an nonstandard URL 3029 { // Try a nonstandard URL
3030 "foobar://user:pass@google.com:80/sup?yo#X#X", 3030 "foobar://user:pass@google.com:80/sup?yo#X#X",
3031 "foobar://user:pass@google.com:80/sup?yo#X#X", 3031 "foobar://user:pass@google.com:80/sup?yo",
3032 }, 3032 },
3033 }; 3033 };
3034 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { 3034 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
3035 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "]: %s", i, 3035 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "]: %s", i,
3036 tests[i].input_url)); 3036 tests[i].input_url));
3037 GURL input_url(GURL(tests[i].input_url)); 3037 GURL input_url(GURL(tests[i].input_url));
3038 GURL expected_url(GURL(tests[i].expected_simplified_url)); 3038 GURL expected_url(GURL(tests[i].expected_simplified_url));
3039 EXPECT_EQ(expected_url, SimplifyUrlForRequest(input_url)); 3039 EXPECT_EQ(expected_url, SimplifyUrlForRequest(input_url));
3040 } 3040 }
3041 } 3041 }
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
3469 TEST_P(NetUtilNonUniqueNameTest, IsHostnameNonUnique) { 3469 TEST_P(NetUtilNonUniqueNameTest, IsHostnameNonUnique) {
3470 const NonUniqueNameTestData& test_data = GetParam(); 3470 const NonUniqueNameTestData& test_data = GetParam();
3471 3471
3472 EXPECT_EQ(test_data.is_unique, IsUnique(test_data.hostname)); 3472 EXPECT_EQ(test_data.is_unique, IsUnique(test_data.hostname));
3473 } 3473 }
3474 3474
3475 INSTANTIATE_TEST_CASE_P(, NetUtilNonUniqueNameTest, 3475 INSTANTIATE_TEST_CASE_P(, NetUtilNonUniqueNameTest,
3476 testing::ValuesIn(kNonUniqueNameTestData)); 3476 testing::ValuesIn(kNonUniqueNameTestData));
3477 3477
3478 } // namespace net 3478 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | url/gurl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698