Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(443)

Unified Diff: net/spdy/spdy_proxy_client_socket_unittest.cc

Issue 2365263004: Make (almost) all SpdySessions secure in unittests. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/spdy_http_stream_unittest.cc ('k') | net/spdy/spdy_session_pool_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_proxy_client_socket_unittest.cc
diff --git a/net/spdy/spdy_proxy_client_socket_unittest.cc b/net/spdy/spdy_proxy_client_socket_unittest.cc
index 8af17d97ad620f0454c982d9045f271a46c36604..54e2da1d4a9e34231b406b5cb7d95fde58ac865b 100644
--- a/net/spdy/spdy_proxy_client_socket_unittest.cc
+++ b/net/spdy/spdy_proxy_client_socket_unittest.cc
@@ -30,7 +30,9 @@
#include "net/spdy/spdy_protocol.h"
#include "net/spdy/spdy_session_pool.h"
#include "net/spdy/spdy_test_util_common.h"
+#include "net/test/cert_test_util.h"
#include "net/test/gtest_util.h"
+#include "net/test/test_data_directory.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
@@ -181,14 +183,19 @@ void SpdyProxyClientSocketTest::Initialize(MockRead* reads,
data_.reset(
new SequencedSocketData(reads, reads_count, writes, writes_count));
data_->set_connect_data(connect_data_);
-
session_deps_.socket_factory->AddSocketDataProvider(data_.get());
+
+ SSLSocketDataProvider ssl(SYNCHRONOUS, OK);
+ ssl.cert = ImportCertFromFile(GetTestCertsDirectory(), "spdy_pooling.pem");
+ ASSERT_TRUE(ssl.cert);
+ session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl);
+
session_deps_.host_resolver->set_synchronous_mode(true);
session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_);
// Creates the SPDY session and stream.
- spdy_session_ = CreateInsecureSpdySession(
+ spdy_session_ = CreateSecureSpdySession(
session_.get(), endpoint_spdy_session_key_, NetLogWithSource());
base::WeakPtr<SpdyStream> spdy_stream(
CreateStreamSynchronously(
« no previous file with comments | « net/spdy/spdy_http_stream_unittest.cc ('k') | net/spdy/spdy_session_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698