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

Unified Diff: net/socket/ssl_client_socket_unittest.cc

Issue 1371263002: Refactor SSLClientSocket::SerializeNextProtos(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: net/socket/ssl_client_socket_unittest.cc
diff --git a/net/socket/ssl_client_socket_unittest.cc b/net/socket/ssl_client_socket_unittest.cc
index 77a0aab72aeb2fc5cb65696e72fbd5d7e3127e47..6aaf0ef7331e40cfb646b0948dcb9e9385cc4d60 100644
--- a/net/socket/ssl_client_socket_unittest.cc
+++ b/net/socket/ssl_client_socket_unittest.cc
@@ -2368,12 +2368,23 @@ TEST(SSLClientSocket, ClearSessionCache) {
SSLClientSocket::ClearSessionCache();
}
+TEST(SSLClientSocket, DisableHTTP2) {
+ NextProtoVector next_protos;
+ next_protos.push_back(kProtoHTTP11);
+ next_protos.push_back(kProtoHTTP2);
+ next_protos.push_back(kProtoSPDY31);
+ SSLClientSocket::DisableHTTP2(&next_protos);
+ ASSERT_EQ(2u, next_protos.size());
+ EXPECT_EQ(kProtoHTTP11, next_protos[0]);
+ EXPECT_EQ(kProtoSPDY31, next_protos[1]);
+}
+
TEST(SSLClientSocket, SerializeNextProtos) {
NextProtoVector next_protos;
next_protos.push_back(kProtoHTTP11);
next_protos.push_back(kProtoSPDY31);
static std::vector<uint8_t> serialized =
- SSLClientSocket::SerializeNextProtos(next_protos, true);
+ SSLClientSocket::SerializeNextProtos(next_protos);
ASSERT_EQ(18u, serialized.size());
EXPECT_EQ(8, serialized[0]); // length("http/1.1")
EXPECT_EQ('h', serialized[1]);
« net/socket/ssl_client_socket_nss.cc ('K') | « net/socket/ssl_client_socket_openssl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698