OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "components/history/core/browser/url_utils.h" | 5 #include "components/history/core/browser/url_utils.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
| 9 #include "base/macros.h" |
7 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
8 #include "url/gurl.h" | 11 #include "url/gurl.h" |
9 | 12 |
10 namespace history { | 13 namespace history { |
11 | 14 |
12 namespace { | 15 namespace { |
13 | 16 |
14 TEST(HistoryUrlUtilsTest, CanonicalURLStringCompare) { | 17 TEST(HistoryUrlUtilsTest, CanonicalURLStringCompare) { |
15 // Comprehensive test by comparing each pair in sorted list. O(n^2). | 18 // Comprehensive test by comparing each pair in sorted list. O(n^2). |
16 const char* sorted_list[] = { | 19 const char* sorted_list[] = { |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 TEST(HistoryUrlUtilsTest, HostForTopHosts) { | 132 TEST(HistoryUrlUtilsTest, HostForTopHosts) { |
130 EXPECT_EQ("foo.com", HostForTopHosts(GURL("https://foo.com/bar"))); | 133 EXPECT_EQ("foo.com", HostForTopHosts(GURL("https://foo.com/bar"))); |
131 EXPECT_EQ("foo.com", HostForTopHosts(GURL("http://foo.com:999/bar"))); | 134 EXPECT_EQ("foo.com", HostForTopHosts(GURL("http://foo.com:999/bar"))); |
132 EXPECT_EQ("foo.com", HostForTopHosts(GURL("http://www.foo.com/bar"))); | 135 EXPECT_EQ("foo.com", HostForTopHosts(GURL("http://www.foo.com/bar"))); |
133 EXPECT_EQ("foo.com", HostForTopHosts(GURL("HtTP://WWw.FoO.cOM/BAR"))); | 136 EXPECT_EQ("foo.com", HostForTopHosts(GURL("HtTP://WWw.FoO.cOM/BAR"))); |
134 } | 137 } |
135 | 138 |
136 } // namespace | 139 } // namespace |
137 | 140 |
138 } // namespace history | 141 } // namespace history |
OLD | NEW |