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

Side by Side Diff: net/socket/ssl_client_socket_unittest.cc

Issue 757033004: Do not use HTTP/2 without adequate security. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Do not leave out TLS version check. Created 6 years 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/socket/ssl_client_socket.h" 5 #include "net/socket/ssl_client_socket.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 2338 matching lines...) Expand 10 before | Expand all | Expand 10 after
2349 // explicit NSS initialization. 2349 // explicit NSS initialization.
2350 TEST(SSLClientSocket, ClearSessionCache) { 2350 TEST(SSLClientSocket, ClearSessionCache) {
2351 SSLClientSocket::ClearSessionCache(); 2351 SSLClientSocket::ClearSessionCache();
2352 } 2352 }
2353 2353
2354 TEST(SSLClientSocket, SerializeNextProtos) { 2354 TEST(SSLClientSocket, SerializeNextProtos) {
2355 NextProtoVector next_protos; 2355 NextProtoVector next_protos;
2356 next_protos.push_back(kProtoHTTP11); 2356 next_protos.push_back(kProtoHTTP11);
2357 next_protos.push_back(kProtoSPDY31); 2357 next_protos.push_back(kProtoSPDY31);
2358 static std::vector<uint8_t> serialized = 2358 static std::vector<uint8_t> serialized =
2359 SSLClientSocket::SerializeNextProtos(next_protos); 2359 SSLClientSocket::SerializeNextProtos(next_protos, true);
2360 ASSERT_EQ(18u, serialized.size()); 2360 ASSERT_EQ(18u, serialized.size());
2361 EXPECT_EQ(8, serialized[0]); // length("http/1.1") 2361 EXPECT_EQ(8, serialized[0]); // length("http/1.1")
2362 EXPECT_EQ('h', serialized[1]); 2362 EXPECT_EQ('h', serialized[1]);
2363 EXPECT_EQ('t', serialized[2]); 2363 EXPECT_EQ('t', serialized[2]);
2364 EXPECT_EQ('t', serialized[3]); 2364 EXPECT_EQ('t', serialized[3]);
2365 EXPECT_EQ('p', serialized[4]); 2365 EXPECT_EQ('p', serialized[4]);
2366 EXPECT_EQ('/', serialized[5]); 2366 EXPECT_EQ('/', serialized[5]);
2367 EXPECT_EQ('1', serialized[6]); 2367 EXPECT_EQ('1', serialized[6]);
2368 EXPECT_EQ('.', serialized[7]); 2368 EXPECT_EQ('.', serialized[7]);
2369 EXPECT_EQ('1', serialized[8]); 2369 EXPECT_EQ('1', serialized[8]);
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
3100 ssl_config.channel_id_enabled = true; 3100 ssl_config.channel_id_enabled = true;
3101 3101
3102 int rv; 3102 int rv;
3103 ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv)); 3103 ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv));
3104 3104
3105 EXPECT_EQ(ERR_UNEXPECTED, rv); 3105 EXPECT_EQ(ERR_UNEXPECTED, rv);
3106 EXPECT_FALSE(sock_->IsConnected()); 3106 EXPECT_FALSE(sock_->IsConnected());
3107 } 3107 }
3108 3108
3109 } // namespace net 3109 } // namespace net
OLDNEW
« net/socket/ssl_client_socket_openssl.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