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

Side by Side Diff: net/http/http_network_transaction_unittest.cc

Issue 1387363004: Disable HTTP/2 over NPN (with OpenSSL). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable NPN in NSS if npn_protos.empty(). Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/http/http_network_transaction.h" 5 #include "net/http/http_network_transaction.h"
6 6
7 #include <math.h> // ceil 7 #include <math.h> // ceil
8 #include <stdarg.h> 8 #include <stdarg.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after
1458 data2_reads.push_back(MockRead(ASYNC, kHttpData, strlen(kHttpData), 2)); 1458 data2_reads.push_back(MockRead(ASYNC, kHttpData, strlen(kHttpData), 2));
1459 data2_reads.push_back(MockRead(ASYNC, OK, 3)); 1459 data2_reads.push_back(MockRead(ASYNC, OK, 3));
1460 } 1460 }
1461 SequencedSocketData data2(&data2_reads[0], data2_reads.size(), 1461 SequencedSocketData data2(&data2_reads[0], data2_reads.size(),
1462 &data2_writes[0], data2_writes.size()); 1462 &data2_writes[0], data2_writes.size());
1463 session_deps_.socket_factory->AddSocketDataProvider(&data2); 1463 session_deps_.socket_factory->AddSocketDataProvider(&data2);
1464 1464
1465 // Preconnect a socket. 1465 // Preconnect a socket.
1466 SSLConfig ssl_config; 1466 SSLConfig ssl_config;
1467 session->ssl_config_service()->GetSSLConfig(&ssl_config); 1467 session->ssl_config_service()->GetSSLConfig(&ssl_config);
1468 session->GetNextProtos(&ssl_config.next_protos); 1468 session->GetAlpnProtos(&ssl_config.alpn_protos);
1469 session->GetNpnProtos(&ssl_config.npn_protos);
1469 session->http_stream_factory()->PreconnectStreams(1, request, ssl_config, 1470 session->http_stream_factory()->PreconnectStreams(1, request, ssl_config,
1470 ssl_config); 1471 ssl_config);
1471 // Wait for the preconnect to complete. 1472 // Wait for the preconnect to complete.
1472 // TODO(davidben): Some way to wait for an idle socket count might be handy. 1473 // TODO(davidben): Some way to wait for an idle socket count might be handy.
1473 base::RunLoop().RunUntilIdle(); 1474 base::RunLoop().RunUntilIdle();
1474 EXPECT_EQ(1, GetIdleSocketCountInSSLSocketPool(session.get())); 1475 EXPECT_EQ(1, GetIdleSocketCountInSSLSocketPool(session.get()));
1475 1476
1476 // Make the request. 1477 // Make the request.
1477 TestCompletionCallback callback; 1478 TestCompletionCallback callback;
1478 1479
(...skipping 13830 matching lines...) Expand 10 before | Expand all | Expand 10 after
15309 std::string response_data; 15310 std::string response_data;
15310 EXPECT_EQ(OK, ReadTransaction(trans.get(), &response_data)); 15311 EXPECT_EQ(OK, ReadTransaction(trans.get(), &response_data));
15311 15312
15312 EXPECT_EQ(CountWriteBytes(data_writes, arraysize(data_writes)), 15313 EXPECT_EQ(CountWriteBytes(data_writes, arraysize(data_writes)),
15313 trans->GetTotalSentBytes()); 15314 trans->GetTotalSentBytes());
15314 EXPECT_EQ(CountReadBytes(data_reads, arraysize(data_reads)), 15315 EXPECT_EQ(CountReadBytes(data_reads, arraysize(data_reads)),
15315 trans->GetTotalReceivedBytes()); 15316 trans->GetTotalReceivedBytes());
15316 } 15317 }
15317 15318
15318 } // namespace net 15319 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698