summaryrefslogtreecommitdiffstats
path: root/net/socket
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-18 04:35:41 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-18 04:35:41 +0000
commit0fefd0206fc58c2908f299261a2e3f665266629e (patch)
treeb05ac051184c14260de6eae1c168ccb74bfd4a68 /net/socket
parent966aa081ab4757e0386727ce9873d12dcf87b2b2 (diff)
downloadchromium_src-0fefd0206fc58c2908f299261a2e3f665266629e.zip
chromium_src-0fefd0206fc58c2908f299261a2e3f665266629e.tar.gz
chromium_src-0fefd0206fc58c2908f299261a2e3f665266629e.tar.bz2
net: Make a few test server connection values constants. Also do a little FilePath cleanup while we're at it.
BUG=none TEST=Net unittests do not time out on the fyi wine/valgrind test bot. Review URL: http://codereview.chromium.org/501100 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34933 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket')
-rw-r--r--net/socket/ssl_test_util.cc25
1 files changed, 13 insertions, 12 deletions
diff --git a/net/socket/ssl_test_util.cc b/net/socket/ssl_test_util.cc
index d00b89d..becb322 100644
--- a/net/socket/ssl_test_util.cc
+++ b/net/socket/ssl_test_util.cc
@@ -2,8 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <string>
#include <algorithm>
+#include <string>
+#include <vector>
#include "net/socket/ssl_test_util.h"
@@ -31,6 +32,7 @@
#include "base/path_service.h"
#include "base/string_util.h"
#include "net/base/host_resolver.h"
+#include "net/base/net_test_constants.h"
#include "net/base/test_completion_callback.h"
#include "net/socket/tcp_client_socket.h"
#include "net/socket/tcp_pinger.h"
@@ -47,8 +49,8 @@ static CERTCertificate* LoadTemporaryCert(const FilePath& filename) {
base::EnsureNSSInit();
std::string rawcert;
- if (!file_util::ReadFileToString(filename.ToWStringHack(), &rawcert)) {
- LOG(ERROR) << "Can't load certificate " << filename.ToWStringHack();
+ if (!file_util::ReadFileToString(filename, &rawcert)) {
+ LOG(ERROR) << "Can't load certificate " << filename.value();
return NULL;
}
@@ -56,7 +58,7 @@ static CERTCertificate* LoadTemporaryCert(const FilePath& filename) {
cert = CERT_DecodeCertFromPackage(const_cast<char *>(rawcert.c_str()),
rawcert.length());
if (!cert) {
- LOG(ERROR) << "Can't convert certificate " << filename.ToWStringHack();
+ LOG(ERROR) << "Can't convert certificate " << filename.value();
return NULL;
}
@@ -71,8 +73,7 @@ static CERTCertificate* LoadTemporaryCert(const FilePath& filename) {
rv = CERT_ChangeCertTrust(CERT_GetDefaultCertDB(), cert, &trust);
if (rv != SECSuccess) {
- LOG(ERROR) << "Can't change trust for certificate "
- << filename.ToWStringHack();
+ LOG(ERROR) << "Can't change trust for certificate " << filename.value();
CERT_DestroyCertificate(cert);
return NULL;
}
@@ -84,8 +85,8 @@ static CERTCertificate* LoadTemporaryCert(const FilePath& filename) {
#if defined(OS_MACOSX)
static net::X509Certificate* LoadTemporaryCert(const FilePath& filename) {
std::string rawcert;
- if (!file_util::ReadFileToString(filename.ToWStringHack(), &rawcert)) {
- LOG(ERROR) << "Can't load certificate " << filename.ToWStringHack();
+ if (!file_util::ReadFileToString(filename, &rawcert)) {
+ LOG(ERROR) << "Can't load certificate " << filename.value();
return NULL;
}
@@ -133,10 +134,10 @@ const int TestServerLauncher::kBadHTTPSPort = 9666;
const wchar_t TestServerLauncher::kCertIssuerName[] = L"Test CA";
TestServerLauncher::TestServerLauncher() : process_handle_(
- base::kNullProcessHandle),
- forking_(false),
- connection_attempts_(10),
- connection_timeout_(1000)
+ base::kNullProcessHandle),
+ forking_(false),
+ connection_attempts_(kDefaultTestConnectionAttempts),
+ connection_timeout_(kDefaultTestConnectionTimeout)
#if defined(OS_LINUX)
, cert_(NULL)
#endif