summaryrefslogtreecommitdiffstats
path: root/net/http/http_network_transaction_unittest.cc
diff options
context:
space:
mode:
authorericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-21 22:03:00 +0000
committerericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-21 22:03:00 +0000
commit71e4573a9ff241416f5cfc375dabec8b72c85e3c (patch)
treed6e52e21cd940aef48dc37e9094ba9d66bd6431f /net/http/http_network_transaction_unittest.cc
parentb360895e1e4ba2db735f82d85563a631e1cc0c5b (diff)
downloadchromium_src-71e4573a9ff241416f5cfc375dabec8b72c85e3c.zip
chromium_src-71e4573a9ff241416f5cfc375dabec8b72c85e3c.tar.gz
chromium_src-71e4573a9ff241416f5cfc375dabec8b72c85e3c.tar.bz2
Changes the UI for HTTP/FTP auth challenges to include the server's port. So instead of "www.foo.com" it will say "www.foo.com:80". We need to include the port number since otherwise it can be ambiguous what the actual target server is.
This change also introduces utility function "GetHostAnd[Optional]Port()" to help with forming <host> [":" <port>] strings. BUG=12073 Review URL: http://codereview.chromium.org/112041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16672 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_network_transaction_unittest.cc')
-rw-r--r--net/http/http_network_transaction_unittest.cc41
1 files changed, 14 insertions, 27 deletions
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index 007f0fb..3d5fb44 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -970,8 +970,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuth) {
// The password prompt info should have been set in response->auth_challenge.
EXPECT_FALSE(response->auth_challenge.get() == NULL);
- // TODO(eroman): this should really include the effective port (80)
- EXPECT_EQ(L"www.google.com", response->auth_challenge->host);
+ EXPECT_EQ(L"www.google.com:80", response->auth_challenge->host_and_port);
EXPECT_EQ(L"MyRealm1", response->auth_challenge->realm);
EXPECT_EQ(L"basic", response->auth_challenge->scheme);
@@ -1048,8 +1047,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAlive) {
// The password prompt info should have been set in response->auth_challenge.
EXPECT_FALSE(response->auth_challenge.get() == NULL);
- // TODO(eroman): this should really include the effective port (80)
- EXPECT_EQ(L"www.google.com", response->auth_challenge->host);
+ EXPECT_EQ(L"www.google.com:80", response->auth_challenge->host_and_port);
EXPECT_EQ(L"MyRealm1", response->auth_challenge->realm);
EXPECT_EQ(L"basic", response->auth_challenge->scheme);
@@ -1129,8 +1127,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAliveNoBody) {
// The password prompt info should have been set in response->auth_challenge.
EXPECT_FALSE(response->auth_challenge.get() == NULL);
- // TODO(eroman): this should really include the effective port (80)
- EXPECT_EQ(L"www.google.com", response->auth_challenge->host);
+ EXPECT_EQ(L"www.google.com:80", response->auth_challenge->host_and_port);
EXPECT_EQ(L"MyRealm1", response->auth_challenge->realm);
EXPECT_EQ(L"basic", response->auth_challenge->scheme);
@@ -1213,8 +1210,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAliveLargeBody) {
// The password prompt info should have been set in response->auth_challenge.
EXPECT_FALSE(response->auth_challenge.get() == NULL);
- // TODO(eroman): this should really include the effective port (80)
- EXPECT_EQ(L"www.google.com", response->auth_challenge->host);
+ EXPECT_EQ(L"www.google.com:80", response->auth_challenge->host_and_port);
EXPECT_EQ(L"MyRealm1", response->auth_challenge->realm);
EXPECT_EQ(L"basic", response->auth_challenge->scheme);
@@ -1304,8 +1300,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthProxyKeepAlive) {
// The password prompt info should have been set in response->auth_challenge.
EXPECT_FALSE(response->auth_challenge.get() == NULL);
- // TODO(eroman): this should really include the effective port (80)
- EXPECT_EQ(L"myproxy:70", response->auth_challenge->host);
+ EXPECT_EQ(L"myproxy:70", response->auth_challenge->host_and_port);
EXPECT_EQ(L"MyRealm1", response->auth_challenge->realm);
EXPECT_EQ(L"basic", response->auth_challenge->scheme);
@@ -1329,8 +1324,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthProxyKeepAlive) {
// The password prompt info should have been set in response->auth_challenge.
EXPECT_FALSE(response->auth_challenge.get() == NULL);
- // TODO(eroman): this should really include the effective port (80)
- EXPECT_EQ(L"myproxy:70", response->auth_challenge->host);
+ EXPECT_EQ(L"myproxy:70", response->auth_challenge->host_and_port);
EXPECT_EQ(L"MyRealm1", response->auth_challenge->realm);
EXPECT_EQ(L"basic", response->auth_challenge->scheme);
}
@@ -1712,7 +1706,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthProxyThenServer) {
// The password prompt info should have been set in response->auth_challenge.
EXPECT_FALSE(response->auth_challenge.get() == NULL);
- EXPECT_EQ(L"myproxy:70", response->auth_challenge->host);
+ EXPECT_EQ(L"myproxy:70", response->auth_challenge->host_and_port);
EXPECT_EQ(L"MyRealm1", response->auth_challenge->realm);
EXPECT_EQ(L"basic", response->auth_challenge->scheme);
@@ -1728,8 +1722,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthProxyThenServer) {
EXPECT_FALSE(response == NULL);
EXPECT_FALSE(response->auth_challenge.get() == NULL);
- // TODO(eroman): this should really include the effective port (80)
- EXPECT_EQ(L"www.google.com", response->auth_challenge->host);
+ EXPECT_EQ(L"www.google.com:80", response->auth_challenge->host_and_port);
EXPECT_EQ(L"MyRealm1", response->auth_challenge->realm);
EXPECT_EQ(L"basic", response->auth_challenge->scheme);
@@ -1860,8 +1853,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMAuth1) {
// The password prompt info should have been set in response->auth_challenge.
EXPECT_FALSE(response->auth_challenge.get() == NULL);
- // TODO(eroman): this should really include the effective port (80)
- EXPECT_EQ(L"172.22.68.17", response->auth_challenge->host);
+ EXPECT_EQ(L"172.22.68.17:80", response->auth_challenge->host_and_port);
EXPECT_EQ(L"", response->auth_challenge->realm);
EXPECT_EQ(L"ntlm", response->auth_challenge->scheme);
@@ -2041,8 +2033,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMAuth2) {
// The password prompt info should have been set in response->auth_challenge.
EXPECT_FALSE(response->auth_challenge.get() == NULL);
- // TODO(eroman): this should really include the effective port (80)
- EXPECT_EQ(L"172.22.68.17", response->auth_challenge->host);
+ EXPECT_EQ(L"172.22.68.17:80", response->auth_challenge->host_and_port);
EXPECT_EQ(L"", response->auth_challenge->realm);
EXPECT_EQ(L"ntlm", response->auth_challenge->scheme);
@@ -2069,8 +2060,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMAuth2) {
// The password prompt info should have been set in response->auth_challenge.
EXPECT_FALSE(response->auth_challenge.get() == NULL);
- // TODO(eroman): this should really include the effective port (80)
- EXPECT_EQ(L"172.22.68.17", response->auth_challenge->host);
+ EXPECT_EQ(L"172.22.68.17:80", response->auth_challenge->host_and_port);
EXPECT_EQ(L"", response->auth_challenge->realm);
EXPECT_EQ(L"ntlm", response->auth_challenge->scheme);
@@ -2553,8 +2543,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) {
// response->auth_challenge.
EXPECT_FALSE(response->auth_challenge.get() == NULL);
- // TODO(eroman): this should really include the effective port (80)
- EXPECT_EQ(L"www.google.com", response->auth_challenge->host);
+ EXPECT_EQ(L"www.google.com:80", response->auth_challenge->host_and_port);
EXPECT_EQ(L"MyRealm1", response->auth_challenge->realm);
EXPECT_EQ(L"basic", response->auth_challenge->scheme);
@@ -2644,8 +2633,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) {
// response->auth_challenge.
EXPECT_FALSE(response->auth_challenge.get() == NULL);
- // TODO(eroman): this should really include the effective port (80)
- EXPECT_EQ(L"www.google.com", response->auth_challenge->host);
+ EXPECT_EQ(L"www.google.com:80", response->auth_challenge->host_and_port);
EXPECT_EQ(L"MyRealm2", response->auth_challenge->realm);
EXPECT_EQ(L"basic", response->auth_challenge->scheme);
@@ -2884,8 +2872,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) {
// response->auth_challenge.
EXPECT_FALSE(response->auth_challenge.get() == NULL);
- // TODO(eroman): this should really include the effective port (80)
- EXPECT_EQ(L"www.google.com", response->auth_challenge->host);
+ EXPECT_EQ(L"www.google.com:80", response->auth_challenge->host_and_port);
EXPECT_EQ(L"MyRealm1", response->auth_challenge->realm);
EXPECT_EQ(L"basic", response->auth_challenge->scheme);