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

Unified Diff: net/http/http_network_transaction_unittest.cc

Issue 1453903002: Re-enable HTTP/2 over NPN (for OpenSSL). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initialize |enable_npn| in other SpdySessionDependencies constructor. Created 5 years, 1 month 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/http/http_network_transaction.h ('k') | net/spdy/spdy_test_util_common.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_transaction_unittest.cc
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index 54c689b0a5e653c76224535c6c841509ba70ce19..b33d9bad49e5cd01aee267a0402a8f16a9c145dc 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -81,6 +81,7 @@
#include "net/ssl/ssl_private_key.h"
#include "net/test/cert_test_util.h"
#include "net/websockets/websocket_handshake_stream_base.h"
+#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
#include "url/gurl.h"
@@ -15466,4 +15467,29 @@ TEST_P(HttpNetworkTransactionTest, TotalNetworkBytesChunkedPost) {
trans->GetTotalReceivedBytes());
}
+TEST_P(HttpNetworkTransactionTest, EnableNPN) {
+ session_deps_.next_protos = NextProtosDefaults();
+ session_deps_.enable_npn = true;
+
+ scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+ HttpNetworkTransaction trans(DEFAULT_PRIORITY, session.get());
+
+ EXPECT_THAT(trans.server_ssl_config_.alpn_protos,
+ testing::ElementsAre(kProtoHTTP2, kProtoSPDY31, kProtoHTTP11));
+ EXPECT_THAT(trans.server_ssl_config_.npn_protos,
+ testing::ElementsAre(kProtoHTTP2, kProtoSPDY31, kProtoHTTP11));
+}
+
+TEST_P(HttpNetworkTransactionTest, DisableNPN) {
+ session_deps_.next_protos = NextProtosDefaults();
+ session_deps_.enable_npn = false;
+
+ scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+ HttpNetworkTransaction trans(DEFAULT_PRIORITY, session.get());
+
+ EXPECT_THAT(trans.server_ssl_config_.alpn_protos,
+ testing::ElementsAre(kProtoHTTP2, kProtoSPDY31, kProtoHTTP11));
+ EXPECT_TRUE(trans.server_ssl_config_.npn_protos.empty());
+}
+
} // namespace net
« no previous file with comments | « net/http/http_network_transaction.h ('k') | net/spdy/spdy_test_util_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698