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

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: Re: #7. 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
« no previous file with comments | « net/http/http_network_transaction.cc ('k') | net/http/http_server_properties.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after
1459 data2_reads.push_back(MockRead(ASYNC, kHttpData, strlen(kHttpData), 2)); 1459 data2_reads.push_back(MockRead(ASYNC, kHttpData, strlen(kHttpData), 2));
1460 data2_reads.push_back(MockRead(ASYNC, OK, 3)); 1460 data2_reads.push_back(MockRead(ASYNC, OK, 3));
1461 } 1461 }
1462 SequencedSocketData data2(&data2_reads[0], data2_reads.size(), 1462 SequencedSocketData data2(&data2_reads[0], data2_reads.size(),
1463 &data2_writes[0], data2_writes.size()); 1463 &data2_writes[0], data2_writes.size());
1464 session_deps_.socket_factory->AddSocketDataProvider(&data2); 1464 session_deps_.socket_factory->AddSocketDataProvider(&data2);
1465 1465
1466 // Preconnect a socket. 1466 // Preconnect a socket.
1467 SSLConfig ssl_config; 1467 SSLConfig ssl_config;
1468 session->ssl_config_service()->GetSSLConfig(&ssl_config); 1468 session->ssl_config_service()->GetSSLConfig(&ssl_config);
1469 session->GetNextProtos(&ssl_config.next_protos); 1469 session->GetAlpnProtos(&ssl_config.alpn_protos);
1470 session->GetNpnProtos(&ssl_config.npn_protos);
1470 session->http_stream_factory()->PreconnectStreams(1, request, ssl_config, 1471 session->http_stream_factory()->PreconnectStreams(1, request, ssl_config,
1471 ssl_config); 1472 ssl_config);
1472 // Wait for the preconnect to complete. 1473 // Wait for the preconnect to complete.
1473 // TODO(davidben): Some way to wait for an idle socket count might be handy. 1474 // TODO(davidben): Some way to wait for an idle socket count might be handy.
1474 base::RunLoop().RunUntilIdle(); 1475 base::RunLoop().RunUntilIdle();
1475 EXPECT_EQ(1, GetIdleSocketCountInSSLSocketPool(session.get())); 1476 EXPECT_EQ(1, GetIdleSocketCountInSSLSocketPool(session.get()));
1476 1477
1477 // Make the request. 1478 // Make the request.
1478 TestCompletionCallback callback; 1479 TestCompletionCallback callback;
1479 1480
(...skipping 13829 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
« no previous file with comments | « net/http/http_network_transaction.cc ('k') | net/http/http_server_properties.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698