Fix the libjingle_media_unittest failure in Windows build by modifying libjingle_tests.gyp and sctpdataengine_unittests.cc instead of ssladapter.cc.

R=harryjin@google.com, pthatcher@webrtc.org, tpsiaki@google.com

Review URL: https://webrtc-codereview.appspot.com/22699004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7245 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
thorcarpenter@google.com 2014-09-19 17:54:00 +00:00
parent e65812427d
commit c1eebfa107
2 changed files with 16 additions and 0 deletions

View File

@ -153,6 +153,11 @@
],
'conditions': [
['OS=="win"', {
'dependencies': [
'<(DEPTH)/net/third_party/nss/ssl.gyp:libssl',
'<(DEPTH)/third_party/nss/nss.gyp:nspr',
'<(DEPTH)/third_party/nss/nss.gyp:nss',
],
'msvs_settings': {
'VCLinkerTool': {
'AdditionalDependencies': [

View File

@ -45,6 +45,11 @@
#include "webrtc/base/ssladapter.h"
#include "webrtc/base/thread.h"
#ifdef HAVE_NSS_SSL_H
// TODO(thorcarpenter): Remove after webrtc switches over to BoringSSL.
#include "webrtc/base/nssstreamadapter.h"
#endif // HAVE_NSS_SSL_H
enum {
MSG_PACKET = 1,
};
@ -218,6 +223,12 @@ class SctpDataMediaChannelTest : public testing::Test,
// usrsctp uses the NSS random number generator on non-Android platforms,
// so we need to initialize SSL.
static void SetUpTestCase() {
#ifdef HAVE_NSS_SSL_H
// TODO(thorcarpenter): Remove after webrtc switches over to BoringSSL.
if (!rtc::NSSContext::InitializeSSL(NULL)) {
LOG(LS_WARNING) << "Unabled to initialize NSS.";
}
#endif // HAVE_NSS_SSL_H
rtc::InitializeSSL();
}