summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorerikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-24 16:16:20 +0000
committererikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-24 16:16:20 +0000
commitd9fca99ac07676b78cc679b462f4adbeba7c0976 (patch)
tree31e6fd898a6c1766046b180b04d628fffa287ff6
parented37a0944c1d576ff088e1f9f511f6029e79417c (diff)
downloadchromium_src-d9fca99ac07676b78cc679b462f4adbeba7c0976.zip
chromium_src-d9fca99ac07676b78cc679b462f4adbeba7c0976.tar.gz
chromium_src-d9fca99ac07676b78cc679b462f4adbeba7c0976.tar.bz2
Remove usage of a deprecated TestServer constructor.
Hostname must now be explicitly specified (previously default was 127.0.0.1). See the following CL for further details: http://codereview.chromium.org/9369029/ A follow-up CL will remove the deprecated constructor: http://codereview.chromium.org/9431002/ BUG=114369 TEST=everything still compiles and passes Review URL: http://codereview.chromium.org/9430050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123486 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/net/connection_tester_unittest.cc4
-rw-r--r--chrome/browser/net/ftp_browsertest.cc7
-rw-r--r--chrome/browser/net/http_pipelining_compatibility_client_unittest.cc1
-rw-r--r--chrome/browser/net/load_timing_observer_uitest.cc6
-rw-r--r--chrome/browser/net/network_stats_unittest.cc4
-rw-r--r--content/common/net/url_fetcher_impl_unittest.cc62
-rw-r--r--net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc1
-rw-r--r--net/proxy/proxy_resolver_perftest.cc4
-rw-r--r--net/proxy/proxy_script_fetcher_impl_unittest.cc6
-rw-r--r--net/socket/ssl_client_socket_unittest.cc32
-rw-r--r--net/url_request/url_request_unittest.cc9
11 files changed, 100 insertions, 36 deletions
diff --git a/chrome/browser/net/connection_tester_unittest.cc b/chrome/browser/net/connection_tester_unittest.cc
index 327bd65..9f699bd 100644
--- a/chrome/browser/net/connection_tester_unittest.cc
+++ b/chrome/browser/net/connection_tester_unittest.cc
@@ -90,7 +90,9 @@ class ConnectionTesterTest : public PlatformTest {
: message_loop_(MessageLoop::TYPE_IO),
io_thread_(BrowserThread::IO, &message_loop_),
test_server_(net::TestServer::TYPE_HTTP,
- FilePath(FILE_PATH_LITERAL("net/data/url_request_unittest"))),
+ net::TestServer::kLocalhost,
+ FilePath(
+ FILE_PATH_LITERAL("net/data/url_request_unittest"))),
proxy_script_fetcher_context_(new net::URLRequestContext) {
InitializeRequestContext();
}
diff --git a/chrome/browser/net/ftp_browsertest.cc b/chrome/browser/net/ftp_browsertest.cc
index 8bd955b..a48bd628 100644
--- a/chrome/browser/net/ftp_browsertest.cc
+++ b/chrome/browser/net/ftp_browsertest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -10,7 +10,10 @@
class FtpBrowserTest : public InProcessBrowserTest {
public:
- FtpBrowserTest() : ftp_server_(net::TestServer::TYPE_FTP, FilePath()) {
+ FtpBrowserTest()
+ : ftp_server_(net::TestServer::TYPE_FTP,
+ net::TestServer::kLocalhost,
+ FilePath()) {
}
protected:
diff --git a/chrome/browser/net/http_pipelining_compatibility_client_unittest.cc b/chrome/browser/net/http_pipelining_compatibility_client_unittest.cc
index 39ebfcd..9e3caea 100644
--- a/chrome/browser/net/http_pipelining_compatibility_client_unittest.cc
+++ b/chrome/browser/net/http_pipelining_compatibility_client_unittest.cc
@@ -48,6 +48,7 @@ class HttpPipeliningCompatibilityClientTest : public testing::Test {
HttpPipeliningCompatibilityClientTest()
: test_server_(
net::TestServer::TYPE_HTTP,
+ net::TestServer::kLocalhost,
FilePath(FILE_PATH_LITERAL("chrome/test/data/http_pipelining"))),
io_thread_(content::BrowserThread::IO, &message_loop_) {
}
diff --git a/chrome/browser/net/load_timing_observer_uitest.cc b/chrome/browser/net/load_timing_observer_uitest.cc
index 293e024..2a54b28 100644
--- a/chrome/browser/net/load_timing_observer_uitest.cc
+++ b/chrome/browser/net/load_timing_observer_uitest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -11,7 +11,9 @@
class LoadTimingObserverUITest : public UITest {
public:
LoadTimingObserverUITest()
- : http_server_(net::TestServer::TYPE_HTTP, FilePath()) {
+ : http_server_(net::TestServer::TYPE_HTTP,
+ net::TestServer::kLocalhost,
+ FilePath()) {
dom_automation_enabled_ = true;
}
diff --git a/chrome/browser/net/network_stats_unittest.cc b/chrome/browser/net/network_stats_unittest.cc
index 0d5dd26..321ff7f 100644
--- a/chrome/browser/net/network_stats_unittest.cc
+++ b/chrome/browser/net/network_stats_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -29,6 +29,7 @@ class NetworkStatsTestUDP : public NetworkStatsTest {
public:
NetworkStatsTestUDP()
: test_server_(net::TestServer::TYPE_UDP_ECHO,
+ net::TestServer::kLocalhost,
FilePath(FILE_PATH_LITERAL("net/data"))) {
}
@@ -56,6 +57,7 @@ class NetworkStatsTestTCP : public NetworkStatsTest {
public:
NetworkStatsTestTCP()
: test_server_(net::TestServer::TYPE_TCP_ECHO,
+ net::TestServer::kLocalhost,
FilePath(FILE_PATH_LITERAL("net/data"))) {
}
diff --git a/content/common/net/url_fetcher_impl_unittest.cc b/content/common/net/url_fetcher_impl_unittest.cc
index c00d33d..709c85c 100644
--- a/content/common/net/url_fetcher_impl_unittest.cc
+++ b/content/common/net/url_fetcher_impl_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -280,7 +280,9 @@ void URLFetcherTempFileTest::CreateFetcher(const GURL& url) {
}
TEST_F(URLFetcherTempFileTest, SmallGet) {
- net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot));
+ net::TestServer test_server(net::TestServer::TYPE_HTTP,
+ net::TestServer::kLocalhost,
+ FilePath(kDocRoot));
ASSERT_TRUE(test_server.Start());
// Get a small file.
@@ -296,7 +298,9 @@ TEST_F(URLFetcherTempFileTest, SmallGet) {
}
TEST_F(URLFetcherTempFileTest, LargeGet) {
- net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot));
+ net::TestServer test_server(net::TestServer::TYPE_HTTP,
+ net::TestServer::kLocalhost,
+ FilePath(kDocRoot));
ASSERT_TRUE(test_server.Start());
// Get a file large enough to require more than one read into
@@ -310,7 +314,9 @@ TEST_F(URLFetcherTempFileTest, LargeGet) {
}
TEST_F(URLFetcherTempFileTest, CanTakeOwnershipOfFile) {
- net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot));
+ net::TestServer test_server(net::TestServer::TYPE_HTTP,
+ net::TestServer::kLocalhost,
+ FilePath(kDocRoot));
ASSERT_TRUE(test_server.Start());
// Get a small file.
@@ -526,7 +532,9 @@ void URLFetcherTempFileTest::OnURLFetchComplete(
}
TEST_F(URLFetcherTest, SameThreadsTest) {
- net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot));
+ net::TestServer test_server(net::TestServer::TYPE_HTTP,
+ net::TestServer::kLocalhost,
+ FilePath(kDocRoot));
ASSERT_TRUE(test_server.Start());
// Create the fetcher on the main thread. Since IO will happen on the main
@@ -543,7 +551,9 @@ TEST_F(URLFetcherTest, DISABLED_DifferentThreadsTest) {
#else
TEST_F(URLFetcherTest, DifferentThreadsTest) {
#endif
- net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot));
+ net::TestServer test_server(net::TestServer::TYPE_HTTP,
+ net::TestServer::kLocalhost,
+ FilePath(kDocRoot));
ASSERT_TRUE(test_server.Start());
// Create a separate thread that will create the URLFetcher. The current
@@ -568,7 +578,9 @@ TEST_F(URLFetcherPostTest, DISABLED_Basic) {
#else
TEST_F(URLFetcherPostTest, Basic) {
#endif
- net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot));
+ net::TestServer test_server(net::TestServer::TYPE_HTTP,
+ net::TestServer::kLocalhost,
+ FilePath(kDocRoot));
ASSERT_TRUE(test_server.Start());
CreateFetcher(test_server.GetURL("echo"));
@@ -576,7 +588,9 @@ TEST_F(URLFetcherPostTest, Basic) {
}
TEST_F(URLFetcherHeadersTest, Headers) {
- net::TestServer test_server(net::TestServer::TYPE_HTTP,
+ net::TestServer test_server(
+ net::TestServer::TYPE_HTTP,
+ net::TestServer::kLocalhost,
FilePath(FILE_PATH_LITERAL("net/data/url_request_unittest")));
ASSERT_TRUE(test_server.Start());
@@ -586,7 +600,9 @@ TEST_F(URLFetcherHeadersTest, Headers) {
}
TEST_F(URLFetcherSocketAddressTest, SocketAddress) {
- net::TestServer test_server(net::TestServer::TYPE_HTTP,
+ net::TestServer test_server(
+ net::TestServer::TYPE_HTTP,
+ net::TestServer::kLocalhost,
FilePath(FILE_PATH_LITERAL("net/data/url_request_unittest")));
ASSERT_TRUE(test_server.Start());
expected_port_ = test_server.host_port_pair().port();
@@ -598,7 +614,9 @@ TEST_F(URLFetcherSocketAddressTest, SocketAddress) {
}
TEST_F(URLFetcherProtectTest, Overload) {
- net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot));
+ net::TestServer test_server(net::TestServer::TYPE_HTTP,
+ net::TestServer::kLocalhost,
+ FilePath(kDocRoot));
ASSERT_TRUE(test_server.Start());
GURL url(test_server.GetURL("defaultresponse"));
@@ -619,7 +637,9 @@ TEST_F(URLFetcherProtectTest, Overload) {
}
TEST_F(URLFetcherProtectTest, ServerUnavailable) {
- net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot));
+ net::TestServer test_server(net::TestServer::TYPE_HTTP,
+ net::TestServer::kLocalhost,
+ FilePath(kDocRoot));
ASSERT_TRUE(test_server.Start());
GURL url(test_server.GetURL("files/server-unavailable.html"));
@@ -642,7 +662,9 @@ TEST_F(URLFetcherProtectTest, ServerUnavailable) {
}
TEST_F(URLFetcherProtectTestPassedThrough, ServerUnavailablePropagateResponse) {
- net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot));
+ net::TestServer test_server(net::TestServer::TYPE_HTTP,
+ net::TestServer::kLocalhost,
+ FilePath(kDocRoot));
ASSERT_TRUE(test_server.Start());
GURL url(test_server.GetURL("files/server-unavailable.html"));
@@ -688,7 +710,9 @@ TEST_F(URLFetcherCancelTest, DISABLED_ReleasesContext) {
#else
TEST_F(URLFetcherCancelTest, ReleasesContext) {
#endif
- net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot));
+ net::TestServer test_server(net::TestServer::TYPE_HTTP,
+ net::TestServer::kLocalhost,
+ FilePath(kDocRoot));
ASSERT_TRUE(test_server.Start());
GURL url(test_server.GetURL("files/server-unavailable.html"));
@@ -721,7 +745,9 @@ TEST_F(URLFetcherCancelTest, ReleasesContext) {
}
TEST_F(URLFetcherCancelTest, CancelWhileDelayedStartTaskPending) {
- net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot));
+ net::TestServer test_server(net::TestServer::TYPE_HTTP,
+ net::TestServer::kLocalhost,
+ FilePath(kDocRoot));
ASSERT_TRUE(test_server.Start());
GURL url(test_server.GetURL("files/server-unavailable.html"));
@@ -754,7 +780,9 @@ TEST_F(URLFetcherCancelTest, CancelWhileDelayedStartTaskPending) {
}
TEST_F(URLFetcherMultipleAttemptTest, SameData) {
- net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot));
+ net::TestServer test_server(net::TestServer::TYPE_HTTP,
+ net::TestServer::kLocalhost,
+ FilePath(kDocRoot));
ASSERT_TRUE(test_server.Start());
// Create the fetcher on the main thread. Since IO will happen on the main
@@ -773,7 +801,9 @@ void CancelAllOnIO() {
// Tests to make sure CancelAll() will successfully cancel existing URLFetchers.
TEST_F(URLFetcherTest, CancelAll) {
- net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot));
+ net::TestServer test_server(net::TestServer::TYPE_HTTP,
+ net::TestServer::kLocalhost,
+ FilePath(kDocRoot));
ASSERT_TRUE(test_server.Start());
EXPECT_EQ(0, GetNumFetcherCores());
diff --git a/net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc b/net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc
index f8f2f94..9c66d11 100644
--- a/net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc
+++ b/net/proxy/dhcp_proxy_script_adapter_fetcher_win_unittest.cc
@@ -271,6 +271,7 @@ class MockDhcpRealFetchProxyScriptAdapterFetcher
TEST(DhcpProxyScriptAdapterFetcher, MockDhcpRealFetch) {
TestServer test_server(
TestServer::TYPE_HTTP,
+ net::TestServer::kLocalhost,
FilePath(FILE_PATH_LITERAL("net/data/proxy_script_fetcher_unittest")));
ASSERT_TRUE(test_server.Start());
diff --git a/net/proxy/proxy_resolver_perftest.cc b/net/proxy/proxy_resolver_perftest.cc
index 5de2295..f5994ca 100644
--- a/net/proxy/proxy_resolver_perftest.cc
+++ b/net/proxy/proxy_resolver_perftest.cc
@@ -98,7 +98,9 @@ class PacPerfSuiteRunner {
const std::string& resolver_name)
: resolver_(resolver),
resolver_name_(resolver_name),
- test_server_(net::TestServer::TYPE_HTTP,
+ test_server_(
+ net::TestServer::TYPE_HTTP,
+ net::TestServer::kLocalhost,
FilePath(FILE_PATH_LITERAL("net/data/proxy_resolver_perftest"))) {
}
diff --git a/net/proxy/proxy_script_fetcher_impl_unittest.cc b/net/proxy/proxy_script_fetcher_impl_unittest.cc
index e3c0be9..d29dcba 100644
--- a/net/proxy/proxy_script_fetcher_impl_unittest.cc
+++ b/net/proxy/proxy_script_fetcher_impl_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -118,7 +118,9 @@ GURL GetTestFileUrl(const std::string& relpath) {
class ProxyScriptFetcherImplTest : public PlatformTest {
public:
ProxyScriptFetcherImplTest()
- : test_server_(TestServer::TYPE_HTTP, FilePath(kDocRoot)) {
+ : test_server_(TestServer::TYPE_HTTP,
+ net::TestServer::kLocalhost,
+ FilePath(kDocRoot)) {
}
static void SetUpTestCase() {
diff --git a/net/socket/ssl_client_socket_unittest.cc b/net/socket/ssl_client_socket_unittest.cc
index e43d83e..bf156d1 100644
--- a/net/socket/ssl_client_socket_unittest.cc
+++ b/net/socket/ssl_client_socket_unittest.cc
@@ -67,7 +67,9 @@ static bool LogContainsSSLConnectEndEvent(
};
TEST_F(SSLClientSocketTest, Connect) {
- net::TestServer test_server(net::TestServer::TYPE_HTTPS, FilePath());
+ net::TestServer test_server(net::TestServer::TYPE_HTTPS,
+ net::TestServer::kLocalhost,
+ FilePath());
ASSERT_TRUE(test_server.Start());
net::AddressList addr;
@@ -317,7 +319,9 @@ TEST_F(SSLClientSocketTest, ConnectClientAuthSendNullCert) {
// - Server sends data unexpectedly.
TEST_F(SSLClientSocketTest, Read) {
- net::TestServer test_server(net::TestServer::TYPE_HTTPS, FilePath());
+ net::TestServer test_server(net::TestServer::TYPE_HTTPS,
+ net::TestServer::kLocalhost,
+ FilePath());
ASSERT_TRUE(test_server.Start());
net::AddressList addr;
@@ -371,7 +375,9 @@ TEST_F(SSLClientSocketTest, Read) {
// Test the full duplex mode, with Read and Write pending at the same time.
// This test also serves as a regression test for http://crbug.com/29815.
TEST_F(SSLClientSocketTest, Read_FullDuplex) {
- net::TestServer test_server(net::TestServer::TYPE_HTTPS, FilePath());
+ net::TestServer test_server(net::TestServer::TYPE_HTTPS,
+ net::TestServer::kLocalhost,
+ FilePath());
ASSERT_TRUE(test_server.Start());
net::AddressList addr;
@@ -430,7 +436,9 @@ TEST_F(SSLClientSocketTest, Read_FullDuplex) {
}
TEST_F(SSLClientSocketTest, Read_SmallChunks) {
- net::TestServer test_server(net::TestServer::TYPE_HTTPS, FilePath());
+ net::TestServer test_server(net::TestServer::TYPE_HTTPS,
+ net::TestServer::kLocalhost,
+ FilePath());
ASSERT_TRUE(test_server.Start());
net::AddressList addr;
@@ -481,7 +489,9 @@ TEST_F(SSLClientSocketTest, Read_SmallChunks) {
}
TEST_F(SSLClientSocketTest, Read_Interrupted) {
- net::TestServer test_server(net::TestServer::TYPE_HTTPS, FilePath());
+ net::TestServer test_server(net::TestServer::TYPE_HTTPS,
+ net::TestServer::kLocalhost,
+ FilePath());
ASSERT_TRUE(test_server.Start());
net::AddressList addr;
@@ -529,7 +539,9 @@ TEST_F(SSLClientSocketTest, Read_Interrupted) {
}
TEST_F(SSLClientSocketTest, Read_FullLogging) {
- net::TestServer test_server(net::TestServer::TYPE_HTTPS, FilePath());
+ net::TestServer test_server(net::TestServer::TYPE_HTTPS,
+ net::TestServer::kLocalhost,
+ FilePath());
ASSERT_TRUE(test_server.Start());
net::AddressList addr;
@@ -595,7 +607,9 @@ TEST_F(SSLClientSocketTest, Read_FullLogging) {
// Regression test for http://crbug.com/42538
TEST_F(SSLClientSocketTest, PrematureApplicationData) {
- net::TestServer test_server(net::TestServer::TYPE_HTTPS, FilePath());
+ net::TestServer test_server(net::TestServer::TYPE_HTTPS,
+ net::TestServer::kLocalhost,
+ FilePath());
ASSERT_TRUE(test_server.Start());
net::AddressList addr;
@@ -724,7 +738,9 @@ TEST_F(SSLClientSocketTest, CipherSuiteDisables) {
// Here we verify that such a simple ClientSocketHandle, not associated with any
// client socket pool, can be destroyed safely.
TEST_F(SSLClientSocketTest, ClientSocketHandleNotFromPool) {
- net::TestServer test_server(net::TestServer::TYPE_HTTPS, FilePath());
+ net::TestServer test_server(net::TestServer::TYPE_HTTPS,
+ net::TestServer::kLocalhost,
+ FilePath());
ASSERT_TRUE(test_server.Start());
net::AddressList addr;
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index babe243..caeaf71 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -1211,8 +1211,9 @@ TEST_F(URLRequestTestHTTP, GetZippedTest) {
TEST_F(URLRequestTestHTTP, DISABLED_HTTPSToHTTPRedirectNoRefererTest) {
ASSERT_TRUE(test_server_.Start());
- TestServer https_test_server(
- TestServer::TYPE_HTTPS, FilePath(FILE_PATH_LITERAL("net/data/ssl")));
+ TestServer https_test_server(TestServer::TYPE_HTTPS,
+ TestServer::kLocalhost,
+ FilePath(FILE_PATH_LITERAL("net/data/ssl")));
ASSERT_TRUE(https_test_server.Start());
// An https server is sent a request with an https referer,
@@ -1274,6 +1275,7 @@ class HTTPSRequestTest : public testing::Test {
// (see bug 102991).
TEST_F(HTTPSRequestTest, DISABLED_HTTPSGetTest) {
TestServer test_server(TestServer::TYPE_HTTPS,
+ TestServer::kLocalhost,
FilePath(FILE_PATH_LITERAL("net/data/ssl")));
ASSERT_TRUE(test_server.Start());
@@ -3646,7 +3648,8 @@ TEST_F(URLRequestTest, RequestCompletionForEmptyResponse) {
class URLRequestTestFTP : public URLRequestTest {
public:
- URLRequestTestFTP() : test_server_(TestServer::TYPE_FTP, FilePath()) {
+ URLRequestTestFTP()
+ : test_server_(TestServer::TYPE_FTP, TestServer::kLocalhost, FilePath()) {
}
protected: