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

Side by Side Diff: components/history/core/browser/url_utils_unittest.cc

Issue 1179953005: Add History.TopHostsVisitsByRank UMA metric. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@is_allowed
Patch Set: Use HistogramTester to eliminate test brittleness. Created 5 years, 6 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
« no previous file with comments | « components/history/core/browser/url_utils.cc ('k') | tools/metrics/histograms/histograms.xml » ('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 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 "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "url/gurl.h" 8 #include "url/gurl.h"
9 9
10 namespace history { 10 namespace history {
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 TEST(HistoryUrlUtilsTest, ToggleHTTPAndHTTPS) { 120 TEST(HistoryUrlUtilsTest, ToggleHTTPAndHTTPS) {
121 EXPECT_EQ(GURL("http://www.google.com/test?q#r"), 121 EXPECT_EQ(GURL("http://www.google.com/test?q#r"),
122 ToggleHTTPAndHTTPS(GURL("https://www.google.com/test?q#r"))); 122 ToggleHTTPAndHTTPS(GURL("https://www.google.com/test?q#r")));
123 EXPECT_EQ(GURL("https://www.google.com:137/"), 123 EXPECT_EQ(GURL("https://www.google.com:137/"),
124 ToggleHTTPAndHTTPS(GURL("http://www.google.com:137/"))); 124 ToggleHTTPAndHTTPS(GURL("http://www.google.com:137/")));
125 EXPECT_EQ(GURL::EmptyGURL(), 125 EXPECT_EQ(GURL::EmptyGURL(),
126 ToggleHTTPAndHTTPS(GURL("ftp://www.google.com/"))); 126 ToggleHTTPAndHTTPS(GURL("ftp://www.google.com/")));
127 } 127 }
128 128
129 TEST(HistoryUrlUtilsTest, HostForTopHosts) {
130 EXPECT_EQ("foo.com", HostForTopHosts(GURL("https://foo.com/bar")));
131 EXPECT_EQ("foo.com", HostForTopHosts(GURL("http://foo.com:999/bar")));
132 EXPECT_EQ("foo.com", HostForTopHosts(GURL("http://www.foo.com/bar")));
133 }
134
129 } // namespace 135 } // namespace
130 136
131 } // namespace history 137 } // namespace history
OLDNEW
« no previous file with comments | « components/history/core/browser/url_utils.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698