diff options
Diffstat (limited to 'net/base/net_util_unittest.cc')
-rw-r--r-- | net/base/net_util_unittest.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/net/base/net_util_unittest.cc b/net/base/net_util_unittest.cc index 833375c..0d10bb1 100644 --- a/net/base/net_util_unittest.cc +++ b/net/base/net_util_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -1631,3 +1631,12 @@ TEST(NetUtilTest, SetExplicitlyAllowedPortsTest) { EXPECT_EQ(i, net::explicitly_allowed_ports.size()); } } + +TEST(NetUtilTest, GetHostOrSpecFromURL) { + EXPECT_EQ("example.com", + net::GetHostOrSpecFromURL(GURL("http://example.com/test"))); + EXPECT_EQ("example.com", + net::GetHostOrSpecFromURL(GURL("http://example.com./test"))); + EXPECT_EQ("file:///tmp/test.html", + net::GetHostOrSpecFromURL(GURL("file:///tmp/test.html"))); +} |