summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--base/test/test_suite.h4
-rw-r--r--build/build_config.h5
-rw-r--r--net/http/des.cc6
-rw-r--r--net/socket/ssl_test_util.cc16
4 files changed, 16 insertions, 15 deletions
diff --git a/base/test/test_suite.h b/base/test/test_suite.h
index 2c491c2..94e7b1a 100644
--- a/base/test/test_suite.h
+++ b/base/test/test_suite.h
@@ -212,13 +212,13 @@ class TestSuite {
icu_util::Initialize();
-#if defined(OS_POSIX) && !defined(OS_MACOSX)
+#if defined(USE_NSS)
// Trying to repeatedly initialize and cleanup NSS and NSPR may result in
// a deadlock. Such repeated initialization will happen when using test
// isolation. Prevent problems by initializing NSS here, so that the cleanup
// will be done only on process exit.
base::EnsureNSSInit();
-#endif // defined(OS_POSIX) && !defined(OS_MACOSX)
+#endif // defined(USE_NSS)
}
virtual void Shutdown() {
diff --git a/build/build_config.h b/build/build_config.h
index da7a37f..ebf72f3 100644
--- a/build/build_config.h
+++ b/build/build_config.h
@@ -49,14 +49,15 @@
// For access to standard POSIXish features, use OS_POSIX instead of a
// more specific macro.
-#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_FREEBSD) || defined(OS_OPENBSD)
+#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_FREEBSD) || \
+ defined(OS_OPENBSD)
#define OS_POSIX 1
// Use base::DataPack for name/value pairs.
#define USE_BASE_DATA_PACK 1
#endif
// Use tcmalloc
-#if defined(OS_WIN) && ! defined(NO_TCMALLOC)
+#if defined(OS_WIN) && !defined(NO_TCMALLOC)
#define USE_TCMALLOC 1
#endif
diff --git a/net/http/des.cc b/net/http/des.cc
index 9e56a70..0ca12b9 100644
--- a/net/http/des.cc
+++ b/net/http/des.cc
@@ -4,7 +4,7 @@
#include "net/http/des.h"
-#if defined(OS_LINUX)
+#if defined(USE_NSS)
#include <nss.h>
#include <pk11pub.h>
#elif defined(OS_MACOSX)
@@ -15,7 +15,7 @@
#endif
#include "base/logging.h"
-#if defined(OS_LINUX)
+#if defined(USE_NSS)
#include "base/nss_util.h"
#endif
@@ -85,7 +85,7 @@ void DESMakeKey(const uint8* raw, uint8* key) {
key[7] = DESSetKeyParity((raw[6] << 1));
}
-#if defined(OS_LINUX)
+#if defined(USE_NSS)
void DESEncrypt(const uint8* key, const uint8* src, uint8* hash) {
CK_MECHANISM_TYPE cipher_mech = CKM_DES_ECB;
diff --git a/net/socket/ssl_test_util.cc b/net/socket/ssl_test_util.cc
index cde21f3..60b1f1f 100644
--- a/net/socket/ssl_test_util.cc
+++ b/net/socket/ssl_test_util.cc
@@ -2,18 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "net/socket/ssl_test_util.h"
+
#include <algorithm>
#include <string>
#include <vector>
-#include "net/socket/ssl_test_util.h"
-
#include "build/build_config.h"
#if defined(OS_WIN)
#include <windows.h>
#include <wincrypt.h>
-#elif defined(OS_LINUX)
+#elif defined(USE_NSS)
#include <nspr.h>
#include <nss.h>
#include <secerr.h>
@@ -44,7 +44,7 @@
namespace {
-#if defined(OS_LINUX)
+#if defined(USE_NSS)
static CERTCertificate* LoadTemporaryCert(const FilePath& filename) {
base::EnsureNSSInit();
@@ -138,7 +138,7 @@ TestServerLauncher::TestServerLauncher() : process_handle_(
forking_(false),
connection_attempts_(kDefaultTestConnectionAttempts),
connection_timeout_(kDefaultTestConnectionTimeout)
-#if defined(OS_LINUX)
+#if defined(USE_NSS)
, cert_(NULL)
#endif
{
@@ -151,7 +151,7 @@ TestServerLauncher::TestServerLauncher(int connection_attempts,
forking_(false),
connection_attempts_(connection_attempts),
connection_timeout_(connection_timeout)
-#if defined(OS_LINUX)
+#if defined(USE_NSS)
, cert_(NULL)
#endif
{
@@ -353,7 +353,7 @@ bool TestServerLauncher::Stop() {
}
TestServerLauncher::~TestServerLauncher() {
-#if defined(OS_LINUX)
+#if defined(USE_NSS)
if (cert_)
CERT_DestroyCertificate(reinterpret_cast<CERTCertificate*>(cert_));
#elif defined(OS_MACOSX)
@@ -381,7 +381,7 @@ FilePath TestServerLauncher::GetExpiredCertPath() {
}
bool TestServerLauncher::LoadTestRootCert() {
-#if defined(OS_LINUX)
+#if defined(USE_NSS)
if (cert_)
return true;