OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/tools/dump_cache/url_utilities.h" | 5 #include "net/tools/dump_cache/url_utilities.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 namespace net { | 13 namespace net { |
14 | 14 |
15 TEST(UrlUtilitiesTest, GetUrlHost) { | 15 TEST(UrlUtilitiesTest, GetUrlHost) { |
16 EXPECT_EQ("www.foo.com", | 16 EXPECT_EQ("www.foo.com", |
17 UrlUtilities::GetUrlHost("http://www.foo.com")); | 17 UrlUtilities::GetUrlHost("http://www.foo.com")); |
18 EXPECT_EQ("www.foo.com", | 18 EXPECT_EQ("www.foo.com", |
19 UrlUtilities::GetUrlHost("http://www.foo.com:80")); | 19 UrlUtilities::GetUrlHost("http://www.foo.com:80")); |
20 EXPECT_EQ("www.foo.com", | 20 EXPECT_EQ("www.foo.com", |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 EXPECT_EQ("%1", UrlUtilities::Unescape("%1")); | 105 EXPECT_EQ("%1", UrlUtilities::Unescape("%1")); |
106 EXPECT_EQ("%1x", UrlUtilities::Unescape("%1x")); | 106 EXPECT_EQ("%1x", UrlUtilities::Unescape("%1x")); |
107 EXPECT_EQ("%%", UrlUtilities::Unescape("%%")); | 107 EXPECT_EQ("%%", UrlUtilities::Unescape("%%")); |
108 // Escapes following non-escapes. | 108 // Escapes following non-escapes. |
109 EXPECT_EQ("%!", UrlUtilities::Unescape("%%21")); | 109 EXPECT_EQ("%!", UrlUtilities::Unescape("%%21")); |
110 EXPECT_EQ("%2!", UrlUtilities::Unescape("%2%21")); | 110 EXPECT_EQ("%2!", UrlUtilities::Unescape("%2%21")); |
111 } | 111 } |
112 | 112 |
113 } // namespace net | 113 } // namespace net |
114 | 114 |
OLD | NEW |