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

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

Issue 1744003: Send content settings based on the URL to the renderer instead of just the host. (Closed)
Patch Set: nits Created 10 years, 8 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 | « net/base/net_util.cc ('k') | no next file » | 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) 2009 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/base/net_util.h" 5 #include "net/base/net_util.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/format_macros.h" 8 #include "base/format_macros.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/sys_string_conversions.h" 10 #include "base/sys_string_conversions.h"
11 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
(...skipping 1612 matching lines...) Expand 10 before | Expand all | Expand 10 after
1624 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(invalid); ++i) { 1624 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(invalid); ++i) {
1625 net::SetExplicitlyAllowedPorts(invalid[i]); 1625 net::SetExplicitlyAllowedPorts(invalid[i]);
1626 EXPECT_EQ(0, static_cast<int>(net::explicitly_allowed_ports.size())); 1626 EXPECT_EQ(0, static_cast<int>(net::explicitly_allowed_ports.size()));
1627 } 1627 }
1628 1628
1629 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(valid); ++i) { 1629 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(valid); ++i) {
1630 net::SetExplicitlyAllowedPorts(valid[i]); 1630 net::SetExplicitlyAllowedPorts(valid[i]);
1631 EXPECT_EQ(i, net::explicitly_allowed_ports.size()); 1631 EXPECT_EQ(i, net::explicitly_allowed_ports.size());
1632 } 1632 }
1633 } 1633 }
1634
1635 TEST(NetUtilTest, GetHostOrSpecFromURL) {
1636 EXPECT_EQ("example.com",
1637 net::GetHostOrSpecFromURL(GURL("http://example.com/test")));
1638 EXPECT_EQ("example.com",
1639 net::GetHostOrSpecFromURL(GURL("http://example.com./test")));
1640 EXPECT_EQ("file:///tmp/test.html",
1641 net::GetHostOrSpecFromURL(GURL("file:///tmp/test.html")));
1642 }
OLDNEW
« no previous file with comments | « net/base/net_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698